|
|
@ -72,7 +72,7 @@ |
|
|
|
</curren-Drawer> |
|
|
|
<!-- 检验弹窗 --> |
|
|
|
<el-dialog |
|
|
|
title="检验" |
|
|
|
:title="isBatchInspect ? '批量检验' : '检验'" |
|
|
|
:visible.sync="inspectShow" |
|
|
|
top="5vh" |
|
|
|
width="88%" |
|
|
@ -89,7 +89,7 @@ |
|
|
|
:searchForm="inspectForm" |
|
|
|
:searchHandle="inspectHandle" |
|
|
|
:rules="inspectRules" |
|
|
|
@submitForm="inspectFormClick(arguments)" |
|
|
|
@submitForm="isBatchInspect ? inspectFormBtachClick(arguments) : inspectFormClick(arguments)" |
|
|
|
> |
|
|
|
<currenTable |
|
|
|
class="jyTable" |
|
|
@ -191,6 +191,7 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-button type="primary" @click="query">查询</el-button> |
|
|
|
<el-button type="primary" @click="reset">重置</el-button> |
|
|
|
<el-button type="warning" @click="batchInspectHandle">批量不合格</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</template> |
|
|
@ -199,17 +200,19 @@ |
|
|
|
prop="details" |
|
|
|
> |
|
|
|
<umyTable |
|
|
|
ref="inspectNoticeDetails_table_ref" |
|
|
|
:setUTableHeight="470" |
|
|
|
:tableData="inspectNoticeDetailsFormData.details" |
|
|
|
:tableColumns="inspectNoticeDetailsTableColumns" |
|
|
|
:tableLoading = "inspectNoticeDetailsTableLoading" |
|
|
|
:isShowIndex="true" |
|
|
|
:selectionTable="false" |
|
|
|
:selectionTable="true" |
|
|
|
:cellClassName="cellClassName" |
|
|
|
:tableBorder="true" |
|
|
|
:tableAlign="'center'" |
|
|
|
:tableHeaderAlign="'center'" |
|
|
|
@buttonClick="inspectDetailsButtonClick" |
|
|
|
@handleSelectionChange="handleSelectDetailZJ" |
|
|
|
> |
|
|
|
</umyTable> |
|
|
|
</el-form-item> |
|
|
@ -274,7 +277,13 @@ import { |
|
|
|
InspectSplitPackingk |
|
|
|
} from "@/api/wms-api" |
|
|
|
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core" |
|
|
|
import { completeSummaryDetailStatus, setDetailDefaultOkStatus, setDetailOkStatus, setDetailNookStatus } from "@/api/wms-job" |
|
|
|
import { |
|
|
|
completeSummaryDetailStatus, |
|
|
|
setDetailDefaultOkStatus, |
|
|
|
setDetailOkStatus, |
|
|
|
setDetailNookStatus, |
|
|
|
setBatchDetailStatus |
|
|
|
} from "@/api/wms-job" |
|
|
|
import { tableMixins } from "@/mixins/TableMixins" |
|
|
|
import { LoadingMixins } from "@/mixins/LoadingMixins" |
|
|
|
import { drawerMixins } from "@/mixins/drawerMixins" |
|
|
@ -406,40 +415,9 @@ export default { |
|
|
|
// inspectUserName: null, |
|
|
|
// receiveUom: null, |
|
|
|
}, |
|
|
|
inspectForm: [ |
|
|
|
{ type: "input", label: "物品代码", prop: "itemCode", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "物品名称", prop: "itemName", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "箱码", prop: "packingCode", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "select", label: "外观", prop: "appearance", options: "inspectAppearanceStatus", colSpan: 12 }, |
|
|
|
// { type: "input", label: "尺寸", prop: "volume", colSpan: 12 }, |
|
|
|
{ type: "input", label: "重量", prop: "weight", colSpan: 12 }, |
|
|
|
{ type: "inputNumber", label: "检验数量", prop: "inspectQty", colSpan: 12 }, |
|
|
|
{ type: "button", label: "其他", buttonText: "添加", click: (val) => { this.inspectAddTable(val) }, colSpan: 24 }, |
|
|
|
], |
|
|
|
inspectHandle: [ |
|
|
|
{ label: "合格", name: "hege", type:"success" }, |
|
|
|
{ label: "不合格", name: "buhege", type:"danger" }, |
|
|
|
{ label: "取消", name: "cancel" }, |
|
|
|
], |
|
|
|
inspectRules: { |
|
|
|
appearance: { required: true, trigger: "blur", message: "不可为空" }, |
|
|
|
// volume: { required: true, trigger: "blur", message: "不可为空" }, |
|
|
|
// weight: { required: true, trigger: "blur", message: "不可为空" }, |
|
|
|
inspectQty: [ |
|
|
|
{ required: true, trigger: "blur", message: "不可为空" }, |
|
|
|
{ |
|
|
|
type: "number", |
|
|
|
trigger: ["blur"], |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
if(Number(value) > Number(this.rowReceiveQty) || Number(value) <= 0){ |
|
|
|
return callback(new Error(`数量必须大于0且不能大于收货数量${this.rowReceiveQty}`)) |
|
|
|
}else{ |
|
|
|
callback() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
}, |
|
|
|
inspectForm: [], |
|
|
|
inspectHandle: [], |
|
|
|
inspectRules: {}, |
|
|
|
inspectOptions:{}, |
|
|
|
inspectDetailsTableColumns:[ |
|
|
|
{ type: "input", label: "名称", prop: "name", width:'100%' }, |
|
|
@ -608,12 +586,84 @@ export default { |
|
|
|
name: 'mx', |
|
|
|
} |
|
|
|
], |
|
|
|
// 是否是批量检验 |
|
|
|
isBatchInspect:false, |
|
|
|
selectedDetailZJ:[], |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.paging(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 节点根据是否批量判断显示 |
|
|
|
initDomIfBatch(){ |
|
|
|
this.initInspectRules() |
|
|
|
this.initInspectHandle() |
|
|
|
this.initInspectForm() |
|
|
|
}, |
|
|
|
// 检验表单数据格式化 |
|
|
|
initInspectForm(){ |
|
|
|
if(this.isBatchInspect){ |
|
|
|
this.inspectForm = [ |
|
|
|
{ type: "input", label: "物品代码", prop: "itemCode", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "物品名称", prop: "itemName", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "select", label: "外观", prop: "appearance", options: "inspectAppearanceStatus", colSpan: 12 }, |
|
|
|
{ type: "input", label: "重量", prop: "weight", colSpan: 12 }, |
|
|
|
{ type: "button", label: "其他", buttonText: "添加", click: (val) => { this.inspectAddTable(val) }, colSpan: 24 }, |
|
|
|
] |
|
|
|
}else{ |
|
|
|
this.inspectForm = [ |
|
|
|
{ type: "input", label: "物品代码", prop: "itemCode", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "物品名称", prop: "itemName", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "箱码", prop: "packingCode", disabled: true, colSpan: 12 }, |
|
|
|
{ type: "select", label: "外观", prop: "appearance", options: "inspectAppearanceStatus", colSpan: 12 }, |
|
|
|
// { type: "input", label: "尺寸", prop: "volume", colSpan: 12 }, |
|
|
|
{ type: "input", label: "重量", prop: "weight", colSpan: 12 }, |
|
|
|
{ type: "inputNumber", label: "检验数量", prop: "inspectQty", colSpan: 12 }, |
|
|
|
{ type: "button", label: "其他", buttonText: "添加", click: (val) => { this.inspectAddTable(val) }, colSpan: 24 }, |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
// 检验表单验证格式化 |
|
|
|
initInspectRules(){ |
|
|
|
if(this.isBatchInspect){ |
|
|
|
this.inspectRules = {} |
|
|
|
}else{ |
|
|
|
this.inspectRules = { |
|
|
|
appearance: { required: true, trigger: "blur", message: "不可为空" }, |
|
|
|
inspectQty: [ |
|
|
|
{ required: true, trigger: "blur", message: "不可为空" }, |
|
|
|
{ |
|
|
|
type: "number", |
|
|
|
trigger: ["blur"], |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
if(Number(value) > Number(this.rowReceiveQty) || Number(value) <= 0){ |
|
|
|
return callback(new Error(`数量必须大于0且不能大于收货数量${this.rowReceiveQty}`)) |
|
|
|
}else{ |
|
|
|
callback() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 检验表单按钮格式化 |
|
|
|
initInspectHandle(){ |
|
|
|
if(this.isBatchInspect){ |
|
|
|
this.inspectHandle=[ |
|
|
|
{ label: "批量不合格", name: "batchBuhege", type:"danger" }, |
|
|
|
{ label: "取消", name: "batchcancel" }, |
|
|
|
] |
|
|
|
}else{ |
|
|
|
this.inspectHandle=[ |
|
|
|
{ label: "合格", name: "hege", type:"success" }, |
|
|
|
{ label: "不合格", name: "buhege", type:"danger" }, |
|
|
|
{ label: "取消", name: "cancel" }, |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 抽屉内部按钮 |
|
|
|
currenDrawerButtonClick(val,index, label,item){ |
|
|
|
if(item.prop == "inspectReport"){ |
|
|
@ -689,13 +739,16 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
// 检验详情按钮 |
|
|
|
buttonClick(row) { |
|
|
|
this.summaryCurrentRow = row |
|
|
|
async buttonClick(row) { |
|
|
|
// 判断状态为完成情况下,不可点击 |
|
|
|
if (row.summaryInspectStatus == 2) { |
|
|
|
this.$message.error('已完成质检') |
|
|
|
return |
|
|
|
} |
|
|
|
let _fleshDeatils = await getDetailed(this.propsData.id, this.URL) |
|
|
|
this.tableDataDetails = JSON.parse(JSON.stringify(_fleshDeatils)) |
|
|
|
let _fleshSummarys = _fleshDeatils.summaryDetails.filter(item=>{return item.id == row.id}) |
|
|
|
this.summaryCurrentRow = _fleshSummarys[0] |
|
|
|
// 展现 质检详情窗口 |
|
|
|
this.Loading.appMainLoading = true |
|
|
|
setTimeout(()=>{ |
|
|
@ -750,7 +803,7 @@ export default { |
|
|
|
// inspectUserPhone: null, |
|
|
|
// stdPackUom: null, |
|
|
|
} |
|
|
|
this.$listAssign(this.inspectNoticeDetailsFormData, row) |
|
|
|
this.$listAssign(this.inspectNoticeDetailsFormData, this.summaryCurrentRow) |
|
|
|
let findRs = this.tableDataDetails.details.filter(item => ( |
|
|
|
item.itemCode == row.itemCode |
|
|
|
)) |
|
|
@ -809,25 +862,41 @@ export default { |
|
|
|
inspectButtonClick(row, index, label) { |
|
|
|
this.inspectFormData.details.splice(row.$index, 1) |
|
|
|
}, |
|
|
|
resetInspectForm(row) { |
|
|
|
async resetInspectForm(row) { |
|
|
|
let _fleshDeatils = await getDetailed(this.propsData.id, this.URL) |
|
|
|
let _fleshRow = _fleshDeatils.details.filter(item=>{return item.id == row.id})[0] |
|
|
|
// this.inspectFormData.inspectQty = null |
|
|
|
// this.$refs.inspectForm_Ref.resetCurrenForm() |
|
|
|
let _detailTable = '[]' |
|
|
|
if(row.otherPropertyJson && row.otherPropertyJson != '' && row.otherPropertyJson != 'null'){ |
|
|
|
_detailTable = JSON.parse(JSON.stringify(row.otherPropertyJson)) |
|
|
|
if(_fleshRow.otherPropertyJson && _fleshRow.otherPropertyJson != '' && _fleshRow.otherPropertyJson != 'null'){ |
|
|
|
_detailTable = JSON.parse(JSON.stringify(_fleshRow.otherPropertyJson)) |
|
|
|
} |
|
|
|
this.inspectFormData = row |
|
|
|
this.inspectFormData = JSON.parse(JSON.stringify(_fleshRow)) |
|
|
|
this.inspectFormData.details = JSON.parse(_detailTable) |
|
|
|
// 默认合格时候检查数量默认赋值 |
|
|
|
if(row.detailInspectStatus == 1){ |
|
|
|
// todo:待测试 |
|
|
|
if(_fleshRow.detailInspectStatus == 1){ |
|
|
|
this.inspectFormData.appearance = '' |
|
|
|
this.inspectFormData.volume = '' |
|
|
|
this.inspectFormData.weight = '' |
|
|
|
this.inspectFormData.otherPropertyJson = '[]' |
|
|
|
this.inspectFormData.details = [] |
|
|
|
this.inspectFormData.inspectQty = row.receiveQty |
|
|
|
this.inspectFormData.inspectQty = _fleshRow.receiveQty |
|
|
|
} |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$refs.inspectForm_Ref.clearValidate() |
|
|
|
}) |
|
|
|
}, |
|
|
|
resetInspectFormBatch(){ |
|
|
|
this.inspectFormData = JSON.parse(JSON.stringify(this.selectedDetailZJ[0])) |
|
|
|
this.inspectFormData.appearance = '' |
|
|
|
this.inspectFormData.volume = '' |
|
|
|
this.inspectFormData.weight = '' |
|
|
|
this.inspectFormData.otherPropertyJson = '[]' |
|
|
|
this.inspectFormData.details = [] |
|
|
|
this.inspectFormData.inspectQty = 0 |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$refs.inspectForm_Ref.clearValidate() |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 质检详情-检验按钮 table中按钮 |
|
|
|
inspectDetailsButtonClick(row, index, label) { |
|
|
@ -863,6 +932,8 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
else if (label == '检验') { |
|
|
|
this.isBatchInspect = false |
|
|
|
this.initDomIfBatch() |
|
|
|
this.rowReceiveQty = row.receiveQty |
|
|
|
getListByItemcode({itemCode: row.itemCode}, 'basedata/item-guide-book').then(res => { |
|
|
|
if (res.length > 0) { |
|
|
@ -873,12 +944,12 @@ export default { |
|
|
|
this.blobName = '' |
|
|
|
if(document.getElementById("uploadPictureCardGuideBook"))document.getElementById("uploadPictureCardGuideBook").innerHTML = '' |
|
|
|
} |
|
|
|
this.inspectShow = true |
|
|
|
this.resetInspectForm(row) |
|
|
|
this.inspectShow = true |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.inspectShow = true |
|
|
|
this.resetInspectForm(row) |
|
|
|
this.inspectShow = true |
|
|
|
}) |
|
|
|
this.rowId = row.id |
|
|
|
} else if (label == '清除检验') { |
|
|
@ -888,7 +959,7 @@ export default { |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.inspectNoticeDetailsTableLoading = true |
|
|
|
setDetailDefaultOkStatus({detailId: this.inspectFormData.id}, this.masterID).then(res => { |
|
|
|
setDetailDefaultOkStatus({detailId: row.id}, this.masterID).then(res => { |
|
|
|
this.$message.success('成功清除检验!') |
|
|
|
// 更新数据============================================================ |
|
|
|
// this.$listAssign(this.inspectNoticeDetailsFormData, res) |
|
|
@ -926,6 +997,36 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 批量操作表格选择 |
|
|
|
handleSelectDetailZJ(val){ |
|
|
|
this.selectedDetailZJ = val; |
|
|
|
}, |
|
|
|
// 批量不合格操作 |
|
|
|
batchInspectHandle(){ |
|
|
|
this.isBatchInspect = true |
|
|
|
this.initDomIfBatch() |
|
|
|
if(!this.selectedDetailZJ || this.selectedDetailZJ.length <= 0){ |
|
|
|
this.$warningMsg("至少选择一条数据") |
|
|
|
return |
|
|
|
} |
|
|
|
let row = this.selectedDetailZJ[0] |
|
|
|
getListByItemcode({itemCode: row.itemCode}, 'basedata/item-guide-book').then(res => { |
|
|
|
if (res.length > 0) { |
|
|
|
this.guideBookData = res[0] |
|
|
|
this.guideBookDatePicture(res[0].pictureBlobName) |
|
|
|
} else { |
|
|
|
this.guideBookData = [] |
|
|
|
this.blobName = '' |
|
|
|
if(document.getElementById("uploadPictureCardGuideBook"))document.getElementById("uploadPictureCardGuideBook").innerHTML = '' |
|
|
|
} |
|
|
|
this.resetInspectFormBatch() |
|
|
|
this.inspectShow = true |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.resetInspectFormBatch() |
|
|
|
this.inspectShow = true |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 检验详情 底部按钮 |
|
|
|
formClick(val){ |
|
|
|
if (val[0] == 0) { |
|
|
@ -1109,6 +1210,41 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 批量不合格检验 底部按钮:批量不合格,取消 |
|
|
|
inspectFormBtachClick(val){ |
|
|
|
let _detailIdList = [] |
|
|
|
this.selectedDetailZJ.forEach(item=>{_detailIdList.push(item.id)}) |
|
|
|
if (val[0] == 0) { |
|
|
|
// 不合格 |
|
|
|
val[1].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
let otherPropertyJson = JSON.stringify(this.inspectFormData.details) |
|
|
|
this.inspectFormData.otherPropertyJson = otherPropertyJson |
|
|
|
this.inspectFormData.detailInspectStatus = 3 //不合格状态 |
|
|
|
this.inspectFormData.guidList = _detailIdList.join(",") |
|
|
|
this.inspectFormData.id = this.propsData.id |
|
|
|
this.Loading.appMainLoading = true |
|
|
|
setBatchDetailStatus(this.inspectFormData).then(res=>{ |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
this.inspectShow = false |
|
|
|
this.buttonClick(this.summaryCurrentRow) |
|
|
|
this.paging() |
|
|
|
this.selectedDetailZJ = [] |
|
|
|
this.$refs.inspectNoticeDetails_table_ref.clearSelection(); |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$errorMsg('请按照提示继续操作') |
|
|
|
return false; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
else if (val[0] == 1) { |
|
|
|
this.inspectShow = false |
|
|
|
} |
|
|
|
}, |
|
|
|
// 检验 table添加按钮 |
|
|
|
inspectAddTable(val) { |
|
|
|
this.editFormData = this.inspectFormData |
|
|
@ -1170,11 +1306,11 @@ export default { |
|
|
|
}, |
|
|
|
//设置指定行、列、具体单元格颜色 |
|
|
|
cellClassName({row, column, rowIndex, columnIndex}){ |
|
|
|
if (row.detailInspectStatus == 1 && columnIndex === 5) { |
|
|
|
if (row.detailInspectStatus == 1 && columnIndex === 6) { |
|
|
|
return 'cell-class-mrhg' //默认合格 |
|
|
|
} else if (row.detailInspectStatus == 2 && columnIndex === 5) { |
|
|
|
} else if (row.detailInspectStatus == 2 && columnIndex === 6) { |
|
|
|
return 'cell-class-hg'//合格 |
|
|
|
} else if (row.detailInspectStatus == 3 && columnIndex === 5) { |
|
|
|
} else if (row.detailInspectStatus == 3 && columnIndex === 6) { |
|
|
|
return 'cell-class-nohg'//不合格 |
|
|
|
}else{ |
|
|
|
return '' |
|
|
|