|
|
@@ -166,7 +166,7 @@
|
|
|
import progressBox from './components/progressBox';
|
|
|
import otherMission from './components/otherMission';
|
|
|
import { getTaskListById } from '@/api/mainData/index.js';
|
|
|
- import { reportPage , getInfoById , reportCount } from '@/api/produceOrder/index.js';
|
|
|
+ import { reportPage , getInfoById , reportCount , writeOffWork } from '@/api/produceOrder/index.js';
|
|
|
export default {
|
|
|
components: {
|
|
|
otherMission,
|
|
|
@@ -963,7 +963,12 @@
|
|
|
},
|
|
|
countMsg: {},
|
|
|
chooseIndex:0,
|
|
|
- chooseItem:''
|
|
|
+ chooseItem:'',
|
|
|
+ request:{
|
|
|
+ isLast:0,
|
|
|
+ nextCompleteNum:0,
|
|
|
+ completeNum:0
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created () {
|
|
|
@@ -976,11 +981,17 @@
|
|
|
this.chooseIndex = tab.index
|
|
|
const chooseItem = this.tabList[this.chooseIndex]
|
|
|
this.chooseItem = this.tabList[this.chooseIndex].taskTypeName
|
|
|
- // this.activeName = chooseItem.taskTypeName || ''
|
|
|
this.activeName = tab.index
|
|
|
this.taskCode = chooseItem.taskCode || ''
|
|
|
this.reload({workOrderId:this.workOrderId, taskCode:this.taskCode})
|
|
|
this.getReportCount()
|
|
|
+ this.request.completeNum = this.tabList[this.chooseIndex].number
|
|
|
+ if(this.chooseIndex==this.tabList.length-1){
|
|
|
+ this.request.isLast = 1
|
|
|
+ }else{
|
|
|
+ this.request.isLast = 0
|
|
|
+ this.request.nextCompleteNum = this.tabList[this.chooseIndex+1].number
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
datasource({ page, limit,where }) {
|
|
|
@@ -1027,10 +1038,27 @@
|
|
|
type: 'warning'
|
|
|
})
|
|
|
.then(() => {
|
|
|
- // batchCompletion([row.id]).then((res) => {
|
|
|
- // this.$message.success('成功');
|
|
|
- // this.reload();
|
|
|
- // });
|
|
|
+ const data = {
|
|
|
+ taskCode:this.taskCode,
|
|
|
+ taskName:this.chooseItem,
|
|
|
+ reportId:row.id,
|
|
|
+ writeOffNum:row.standardNum,
|
|
|
+ ...this.request
|
|
|
+ }
|
|
|
+ writeOffWork(data).then(res=>{
|
|
|
+ if(res){
|
|
|
+ this.$message.success('冲销成功');
|
|
|
+ this.reload({workOrderId:this.workOrderId, taskCode:this.taskCode})
|
|
|
+ }else{
|
|
|
+ this.$confirm(`冲销后的总数不可小于下道工序的总数`, '冲销失败', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
}
|