|
|
@@ -2,7 +2,7 @@
|
|
|
<div class="ele-body">
|
|
|
<div class="page-title">
|
|
|
<el-page-header @back="$router.go(-1)">
|
|
|
- <div slot="content" class="pageContent">
|
|
|
+ <div slot="content" class="pageContent" @click="writeOff">
|
|
|
<div>详情</div>
|
|
|
</div>
|
|
|
</el-page-header>
|
|
|
@@ -978,20 +978,23 @@
|
|
|
methods: {
|
|
|
handleTabClick(tab){
|
|
|
if(this.chooseIndex != tab.index ){
|
|
|
- this.chooseIndex = tab.index
|
|
|
+ this.chooseIndex = Number(tab.index)
|
|
|
const chooseItem = this.tabList[this.chooseIndex]
|
|
|
this.chooseItem = this.tabList[this.chooseIndex].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
|
|
|
- }
|
|
|
+ this.setData()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setData(){
|
|
|
+ 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 }) {
|
|
|
@@ -1018,6 +1021,7 @@
|
|
|
this.chooseIndex = 0
|
|
|
this.reload({workOrderId:this.workOrderId, taskCode:this.taskCode})
|
|
|
this.getReportCount()
|
|
|
+ this.setData()
|
|
|
},
|
|
|
async getReportCount () {
|
|
|
const res = await reportCount({
|
|
|
@@ -1032,11 +1036,16 @@
|
|
|
|
|
|
// 冲销
|
|
|
writeOff(row){
|
|
|
- this.$confirm(`<span style="color: red;">是否要撤销本次报工?</span>`, '冲销', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ const h = this.$createElement
|
|
|
+ this.$confirm('', {
|
|
|
+ message:h('div',null, [
|
|
|
+ h('i',{ class:'el-icon-question',style:'color:#f90;font-size:30px;' }),
|
|
|
+ h('span',{ style:'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;'}, '提示'),
|
|
|
+ h('p',{ style:'margin:10px 0 0 40px;color:red' },'是否要撤销本次报工?')
|
|
|
+ ]),
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ })
|
|
|
.then(() => {
|
|
|
const data = {
|
|
|
taskCode:this.taskCode,
|
|
|
@@ -1046,17 +1055,24 @@
|
|
|
...this.request
|
|
|
}
|
|
|
writeOffWork(data).then(res=>{
|
|
|
- if(res){
|
|
|
+ if(res==1){
|
|
|
this.$message.success('冲销成功');
|
|
|
this.reload({workOrderId:this.workOrderId, taskCode:this.taskCode})
|
|
|
- }else{
|
|
|
- this.$confirm(`冲销后的总数不可小于下道工序的总数`, '冲销失败', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- type: 'warning'
|
|
|
+ }else if(res==0){
|
|
|
+ this.$confirm('', {
|
|
|
+ message:h('div',null, [
|
|
|
+ h('i',{ class:'el-icon-question',style:'color:#f90;font-size:30px;' }),
|
|
|
+ h('span',{ style:'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;color:red'}, '冲销失败'),
|
|
|
+ h('p',{ style:'margin:10px 0 0 40px' },'冲销后的总数不可小于下道工序的总数')
|
|
|
+ ]),
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ showCancelButton: false
|
|
|
})
|
|
|
.then(() => {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
+ }else{
|
|
|
+ this.$message.error('接口异常');
|
|
|
}
|
|
|
})
|
|
|
})
|