Browse Source

2022-07-01 强制关单 提升版本

master
rui_li 4 years ago
parent
commit
50be809db7
  1. 2
      src/App.vue
  2. 7
      src/api/shopOrder/reportFormSearch.js
  3. 1
      src/api/yieldReport/produce_order.js
  4. 130
      src/views/modules/shopOrder/reportFormSearch/searchShopOrderStatusCheck.vue
  5. 2
      src/views/modules/yieldReport/com_cutting_material.vue

2
src/App.vue

@ -11,7 +11,7 @@
data() {
return {
query: {},
version: '1.2.12'
version: '1.2.16'
}
},
created() {

7
src/api/shopOrder/reportFormSearch.js

@ -23,3 +23,10 @@ export const searchShopOrderStatusCheck = data => createAPI(`/reportFormSearch/s
// -------------查询-生产订单生产异常记录--------------
export const searchShopOrderAbnormalRecord = data => createAPI(`/reportFormSearch/searchShopOrderAbnormalRecord`,'post',data)
/*检查是否可以强制关单*/
export const checkForceCloseShopOrder = data => createAPI('/reportFormSearch/checkForceCloseShopOrder', 'post', data)
/*强制关单的操作*/
export const forceCloseShopOrder = data => createAPI('/reportFormSearch/forceCloseShopOrder', 'post', data)

1
src/api/yieldReport/produce_order.js

@ -36,4 +36,3 @@ export const getShopOrder = data => createAPI(`schedule/getShopOrderType`,'POST'
//获取订单信息
export const getScheduleMultiReportSpecialAuth = data => createAPI('scheduling/getScheduleMultiReportSpecialAuth','POST',data)

130
src/views/modules/shopOrder/reportFormSearch/searchShopOrderStatusCheck.vue

@ -39,6 +39,7 @@
<el-option label="已取消" value="已取消"></el-option>
</el-select>
<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
:fields="fields()"
:data="exportData"
@ -58,6 +59,8 @@
<el-table
:height="height"
:data="dataList"
highlight-current-row
@row-click="setCurrentRow"
border
v-loading="dataListLoading"
style="width: 100%;">
@ -80,21 +83,30 @@
</el-table>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 异常原因录入的组件 -->
<comExceptionReason ref="comExceptionReason" :close-on-click-modal="false"
:visible.sync="showExceptionFlag"
@initExceptionReason = "initExceptionReason">
</comExceptionReason>
</div>
</template>
<script>
import {
searchShopOrderStatusCheck
searchShopOrderStatusCheck,
checkForceCloseShopOrder,/*检查是否可以强制关单*/
forceCloseShopOrder,/*强制关单*/
} from "@/api/shopOrder/reportFormSearch.js"
import Chooselist from '@/views/modules/common/Chooselist'
/*添加组件*/
import comExceptionReason from "@/views/modules/yieldReport/com_exception_reason";//
export default {
//-
name: "searchShopOrderStatusCheck",
components: {
Chooselist
Chooselist,
comExceptionReason,/*异常信息的组件*/
},
watch: {
searchData: {
@ -109,6 +121,11 @@
return {
tagNo:'',
// start
currentRow: {},
showExceptionFlag: false,
exceptionFlag: 'N',
exceptionReason: '',
checkFlag: true,
exportData: [],
exportName: "生产订单状态检查"+this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["生产订单状态检查"],
@ -119,9 +136,10 @@
modelInputFlag:true,
selectList:[],
searchData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
partno:'',
orderno:'',
site:'',
status:'',
date1:'',
date2:'',
@ -505,6 +523,108 @@
return s
},
// 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() {

2
src/views/modules/yieldReport/com_cutting_material.vue

@ -154,7 +154,7 @@ export default {
return false;
}
//
if(transQty <= 0){
if(transQty < 0){
this.$message.error('请输入有效的数量!');
return false;
}

Loading…
Cancel
Save