|
|
@ -39,6 +39,7 @@ |
|
|
<el-option label="已取消" value="已取消"></el-option> |
|
|
<el-option label="已取消" value="已取消"></el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'查询'}}</el-button> |
|
|
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'查询'}}</el-button> |
|
|
|
|
|
<el-button @click="checkCloseShopOrder()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'关单'}}</el-button> |
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
:data="exportData" |
|
|
:data="exportData" |
|
|
@ -58,6 +59,8 @@ |
|
|
<el-table |
|
|
<el-table |
|
|
:height="height" |
|
|
:height="height" |
|
|
:data="dataList" |
|
|
:data="dataList" |
|
|
|
|
|
highlight-current-row |
|
|
|
|
|
@row-click="setCurrentRow" |
|
|
border |
|
|
border |
|
|
v-loading="dataListLoading" |
|
|
v-loading="dataListLoading" |
|
|
style="width: 100%;"> |
|
|
style="width: 100%;"> |
|
|
@ -80,21 +83,30 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 异常原因录入的组件 --> |
|
|
|
|
|
<comExceptionReason ref="comExceptionReason" :close-on-click-modal="false" |
|
|
|
|
|
:visible.sync="showExceptionFlag" |
|
|
|
|
|
@initExceptionReason = "initExceptionReason"> |
|
|
|
|
|
</comExceptionReason> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
|
|
|
|
|
|
searchShopOrderStatusCheck |
|
|
|
|
|
|
|
|
searchShopOrderStatusCheck, |
|
|
|
|
|
checkForceCloseShopOrder,/*检查是否可以强制关单*/ |
|
|
|
|
|
forceCloseShopOrder,/*强制关单*/ |
|
|
} from "@/api/shopOrder/reportFormSearch.js" |
|
|
} from "@/api/shopOrder/reportFormSearch.js" |
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
|
|
|
/*添加组件*/ |
|
|
|
|
|
import comExceptionReason from "@/views/modules/yieldReport/com_exception_reason";//异常组件 |
|
|
export default { |
|
|
export default { |
|
|
//查询-生产订单状态检查 |
|
|
//查询-生产订单状态检查 |
|
|
name: "searchShopOrderStatusCheck", |
|
|
name: "searchShopOrderStatusCheck", |
|
|
components: { |
|
|
components: { |
|
|
Chooselist |
|
|
|
|
|
|
|
|
Chooselist, |
|
|
|
|
|
comExceptionReason,/*异常信息的组件*/ |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
searchData: { |
|
|
searchData: { |
|
|
@ -109,6 +121,11 @@ |
|
|
return { |
|
|
return { |
|
|
tagNo:'', |
|
|
tagNo:'', |
|
|
// 导出 start |
|
|
// 导出 start |
|
|
|
|
|
currentRow: {}, |
|
|
|
|
|
showExceptionFlag: false, |
|
|
|
|
|
exceptionFlag: 'N', |
|
|
|
|
|
exceptionReason: '', |
|
|
|
|
|
checkFlag: true, |
|
|
exportData: [], |
|
|
exportData: [], |
|
|
exportName: "生产订单状态检查"+this.dayjs().format('YYYYMMDDHHmmss'), |
|
|
exportName: "生产订单状态检查"+this.dayjs().format('YYYYMMDDHHmmss'), |
|
|
exportHeader: ["生产订单状态检查"], |
|
|
exportHeader: ["生产订单状态检查"], |
|
|
@ -119,9 +136,10 @@ |
|
|
modelInputFlag:true, |
|
|
modelInputFlag:true, |
|
|
selectList:[], |
|
|
selectList:[], |
|
|
searchData: { |
|
|
searchData: { |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
username: this.$store.state.user.name, |
|
|
partno:'', |
|
|
partno:'', |
|
|
orderno:'', |
|
|
orderno:'', |
|
|
site:'', |
|
|
|
|
|
status:'', |
|
|
status:'', |
|
|
date1:'', |
|
|
date1:'', |
|
|
date2:'', |
|
|
date2:'', |
|
|
@ -505,6 +523,108 @@ |
|
|
return s |
|
|
return s |
|
|
}, |
|
|
}, |
|
|
// 导出 end |
|
|
// 导出 end |
|
|
|
|
|
|
|
|
|
|
|
/*设置选中行的参数*/ |
|
|
|
|
|
setCurrentRow(row, column, event) { |
|
|
|
|
|
this.currentRow = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//检查是否可以关单 |
|
|
|
|
|
async checkCloseShopOrder(){ |
|
|
|
|
|
//判断是否选中 |
|
|
|
|
|
if (this.currentRow == null || this.currentRow == {}) { |
|
|
|
|
|
this.$message.error("请先选中关单的工单行!") |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
//拼装数据 |
|
|
|
|
|
let requestData = {'site': this.searchData.site, 'orderNo': this.currentRow.orderno, 'status': this.currentRow.status, |
|
|
|
|
|
'username': this.searchData.username}; |
|
|
|
|
|
//调用方法 检查是否可以关单 |
|
|
|
|
|
await checkForceCloseShopOrder(requestData).then(async ({data}) => { |
|
|
|
|
|
//判断是否校验通过 |
|
|
|
|
|
if(data.code == 400){ |
|
|
|
|
|
this.$message.error(data.msg); |
|
|
|
|
|
}else{ |
|
|
|
|
|
//初始化参数 |
|
|
|
|
|
this.exceptionFlag = 'N'; |
|
|
|
|
|
this.exceptionReason = ''; |
|
|
|
|
|
this.checkFlag = true; |
|
|
|
|
|
//需要循环提示的 |
|
|
|
|
|
let resultList = data.resultList; |
|
|
|
|
|
//开始循环 |
|
|
|
|
|
for(let i = 0; i < resultList.length; i++){ |
|
|
|
|
|
let resultRow = resultList[i]; |
|
|
|
|
|
let resultCode = resultRow.resultCode; |
|
|
|
|
|
//如果存在202的需要输入异常的原因 |
|
|
|
|
|
if(resultCode == 202){ |
|
|
|
|
|
this.exceptionFlag = 'Y'; |
|
|
|
|
|
} |
|
|
|
|
|
let resultMsg = resultRow.resultMsg; |
|
|
|
|
|
if(resultCode != 200){ |
|
|
|
|
|
await this.$confirm(resultMsg, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() =>{ |
|
|
|
|
|
|
|
|
|
|
|
}).catch(()=>{ |
|
|
|
|
|
this.checkFlag = false; |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//如果没有通过校验则 |
|
|
|
|
|
if(!this.checkFlag){ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
//校验通过 |
|
|
|
|
|
//判断是否异常信息 |
|
|
|
|
|
if(this.checkFlag && this.exceptionFlag == 'Y'){ |
|
|
|
|
|
//打开异常的组件 |
|
|
|
|
|
await this.showExceptionReasonModal(); |
|
|
|
|
|
}else if (this.checkFlag && this.exceptionFlag == 'N'){ |
|
|
|
|
|
//如果异常组件信息不用管 |
|
|
|
|
|
await this.forceCloseShopOrderOperation(); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/*强制关闭工单的操作*/ |
|
|
|
|
|
forceCloseShopOrderOperation(){ |
|
|
|
|
|
//组装数据 |
|
|
|
|
|
let requestData = {'site': this.searchData.site, 'orderNo': this.currentRow.orderno, 'status': this.currentRow.status, |
|
|
|
|
|
'username': this.searchData.username, 'exceptionFlag': this.exceptionFlag, 'exceptionReason': this.exceptionReason}; |
|
|
|
|
|
//执行强制结单 |
|
|
|
|
|
forceCloseShopOrder(requestData).then(({data}) => { |
|
|
|
|
|
//提示信息 |
|
|
|
|
|
if (data.code == 200) { |
|
|
|
|
|
this.$message.success(data.msg); |
|
|
|
|
|
//刷新数据 |
|
|
|
|
|
this.getData(); |
|
|
|
|
|
} else{ |
|
|
|
|
|
this.$message.error(data.msg); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/*打开异常原因录入页面*/ |
|
|
|
|
|
async showExceptionReasonModal(){ |
|
|
|
|
|
//打开生产过程的工具的页面 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.showExceptionFlag = true; |
|
|
|
|
|
this.$refs.comExceptionReason.init(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/*处理异常的原因*/ |
|
|
|
|
|
initExceptionReason(exceptionReason){ |
|
|
|
|
|
//处理异常的原因 |
|
|
|
|
|
this.exceptionFlag = 'Y'; |
|
|
|
|
|
this.exceptionReason = exceptionReason; |
|
|
|
|
|
//然后强制结单 |
|
|
|
|
|
this.forceCloseShopOrderOperation(); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
|
|
|
|
|
|
|