|
|
|
|
@ -25,11 +25,15 @@ |
|
|
|
|
<template #menu-left v-if="tabPosition == 'workReporting'"> |
|
|
|
|
<el-form :inline="true" v-model="searchForm"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请扫描流程卡号" @input="handleSearchInput"></el-input> |
|
|
|
|
<el-input |
|
|
|
|
v-model="searchForm.cardNo" |
|
|
|
|
placeholder="请扫描流程卡号" |
|
|
|
|
@keyup.enter.native="handleSearchInput" |
|
|
|
|
></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary">保存</el-button> |
|
|
|
|
<el-button type="primary" @click="changeTeam">转班</el-button> |
|
|
|
|
<el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存</el-button> |
|
|
|
|
<el-button type="primary" @click="changeTeam" :loading="saveLoading">转班</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</template> |
|
|
|
|
@ -47,7 +51,7 @@ |
|
|
|
|
<el-table :data="tableData" style="margin-top: 20px"> |
|
|
|
|
<el-table-column label="数量" prop="workQty"></el-table-column> |
|
|
|
|
<el-table-column label="报工时间" prop="makeTime"></el-table-column> |
|
|
|
|
<el-table-column label="报工人" prop="worker.userId"></el-table-column> |
|
|
|
|
<el-table-column label="报工人" prop="worker"></el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</el-dialog> |
|
|
|
|
<!-- 转班 --> |
|
|
|
|
@ -56,14 +60,18 @@ |
|
|
|
|
<el-form-item> 旧班组:{{ data[0].prWorkOrder.makeTeam.tsName }} </el-form-item> |
|
|
|
|
<el-form-item label="新班组" prop="makeTeam"> |
|
|
|
|
<el-select v-model="teamForm.makeTeam"> |
|
|
|
|
<el-option label="班组一" value="1"></el-option> |
|
|
|
|
<el-option |
|
|
|
|
v-for="(item,index) in teamSetList" |
|
|
|
|
:label="item.tsName" |
|
|
|
|
:value="item.id" |
|
|
|
|
></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="teamDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submit">确 定</el-button> |
|
|
|
|
<el-button type="primary" @click="submit" :loading="saveLoading">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
@ -73,15 +81,26 @@ |
|
|
|
|
<script> |
|
|
|
|
import wordReporting from './js/wordReporting'; |
|
|
|
|
import workReportingData from './js/workReportingData'; |
|
|
|
|
import { getList, getRecordList } from '@/api/productionManagement/workReportingManagement'; |
|
|
|
|
import { getTeamSetList } from '@/api/processManagement/taskProcessing'; |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
getRecordList, |
|
|
|
|
getDataByCardNo, |
|
|
|
|
getDataByWpId, |
|
|
|
|
uploadPlan, |
|
|
|
|
} from '@/api/productionManagement/workReportingManagement'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
saveLoading: false, |
|
|
|
|
tabPosition: 'workReporting', |
|
|
|
|
loading: false, |
|
|
|
|
data: [], |
|
|
|
|
form: {}, |
|
|
|
|
searchForm: { |
|
|
|
|
cardNo: '', |
|
|
|
|
}, |
|
|
|
|
detailDialog: false, |
|
|
|
|
teamDialog: false, |
|
|
|
|
teamForm: {}, |
|
|
|
|
@ -135,6 +154,7 @@ export default { |
|
|
|
|
searchMenuPosition: 'right', |
|
|
|
|
column: [], |
|
|
|
|
}, |
|
|
|
|
teamSetList: [], //班组列表 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -142,43 +162,86 @@ export default { |
|
|
|
|
this.option.column = wordReporting[this.tabPosition]; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取班组列表 |
|
|
|
|
getTeamSetList() { |
|
|
|
|
getTeamSetList().then(res => { |
|
|
|
|
this.teamSetList = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 扫描流程卡号 获取数据 |
|
|
|
|
handleSearchInput(key, value) {}, |
|
|
|
|
handleSearchInput(key, value) { |
|
|
|
|
getDataByCardNo({ cardNo: this.searchForm.cardNo }).then(res => { |
|
|
|
|
this.data = res.data.data.record; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 保存 |
|
|
|
|
saveUpdate() { |
|
|
|
|
this.saveLoading = true; |
|
|
|
|
uploadPlan() |
|
|
|
|
.then(res => { |
|
|
|
|
this.saveLoading = false; |
|
|
|
|
// this.option.column = wordReporting[this.tabPosition]; |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
this.saveLoading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// tab切换 |
|
|
|
|
tabPositionChange() { |
|
|
|
|
this.option.column = wordReporting[this.tabPosition]; |
|
|
|
|
this.onLoad(); |
|
|
|
|
this.page.total = this.data.length; |
|
|
|
|
}, |
|
|
|
|
handleDetail() { |
|
|
|
|
// 报工人详情 |
|
|
|
|
handleDetail(row) { |
|
|
|
|
this.detailDialog = true; |
|
|
|
|
getDataByWpId({ wpId: row.wpId }).then(res => { |
|
|
|
|
// this.detailData = res.data.data |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 转班 |
|
|
|
|
changeTeam() { |
|
|
|
|
this.teamDialog = true; |
|
|
|
|
}, |
|
|
|
|
// 转班保存 |
|
|
|
|
submit() { |
|
|
|
|
this.$refs.teamForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
this.teamDialog = false; |
|
|
|
|
this.saveLoading = true; |
|
|
|
|
shiftTransfer({ |
|
|
|
|
woId: this.woId, |
|
|
|
|
oldTsId: this.teamForm.tsId, |
|
|
|
|
newTsId: this.teamForm.tsId, |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
this.saveLoading = false; |
|
|
|
|
this.teamDialog = false; |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
this.teamDialog = false; |
|
|
|
|
this.saveLoading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 页面切换获取数据 |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
if (this.tabPosition == 'workReporting') { |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.loading = false; |
|
|
|
|
this.page.total = res.data.data.total; |
|
|
|
|
this.option.selection = true |
|
|
|
|
this.selectionClear(); |
|
|
|
|
}); |
|
|
|
|
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
// this.data = res.data.data.records; |
|
|
|
|
// this.loading = false; |
|
|
|
|
// this.page.total = res.data.data.total; |
|
|
|
|
// this.option.selection = true; |
|
|
|
|
// this.selectionClear(); |
|
|
|
|
// }); |
|
|
|
|
} else { |
|
|
|
|
getRecordList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( |
|
|
|
|
res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.loading = false; |
|
|
|
|
this.page.total = res.data.data.total; |
|
|
|
|
this.option.selection = false |
|
|
|
|
this.option.selection = false; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|