Browse Source

【nev-pc】报检单-批量不合格功能开发

ag_report_nev
安虹睿 12 months ago
parent
commit
cd34d70f1c
  1. 10
      fe/PC/src/api/wms-job.js
  2. 4
      fe/PC/src/components/currenForm/index.vue
  3. 244
      fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue

10
fe/PC/src/api/wms-job.js

@ -245,6 +245,16 @@ export function setDetailNookStatus(params, id, data) {
}) })
} }
//质检——批量设置为合格/不合格
export function setBatchDetailStatus(data) {
return request({
url: baseURL + 'wms/store/inspect-job/set-many-detail-status',
method: 'post',
params:{id:data.id},
data
})
}
// 盘点任务-批量重盘 // 盘点任务-批量重盘
export function countJobResetByNumber(data) { export function countJobResetByNumber(data) {
return request({ return request({

4
fe/PC/src/components/currenForm/index.vue

@ -855,8 +855,10 @@ export default {
resetCurrenForm() { resetCurrenForm() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
}, },
clearValidate() {
this.$refs.form.clearValidate();
},
restrictionRule(item, prop) { restrictionRule(item, prop) {
if(prop) { if(prop) {
console.log('item',item) console.log('item',item)
console.log('prop', prop) console.log('prop', prop)

244
fe/PC/src/views/rawMaterialManage/quality/InspectRequest.vue

@ -72,7 +72,7 @@
</curren-Drawer> </curren-Drawer>
<!-- 检验弹窗 --> <!-- 检验弹窗 -->
<el-dialog <el-dialog
title="检验" :title="isBatchInspect ? '批量检验' : '检验'"
:visible.sync="inspectShow" :visible.sync="inspectShow"
top="5vh" top="5vh"
width="88%" width="88%"
@ -89,7 +89,7 @@
:searchForm="inspectForm" :searchForm="inspectForm"
:searchHandle="inspectHandle" :searchHandle="inspectHandle"
:rules="inspectRules" :rules="inspectRules"
@submitForm="inspectFormClick(arguments)" @submitForm="isBatchInspect ? inspectFormBtachClick(arguments) : inspectFormClick(arguments)"
> >
<currenTable <currenTable
class="jyTable" class="jyTable"
@ -191,6 +191,7 @@
<el-col :span="8"> <el-col :span="8">
<el-button type="primary" @click="query">查询</el-button> <el-button type="primary" @click="query">查询</el-button>
<el-button type="primary" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
<el-button type="warning" @click="batchInspectHandle">批量不合格</el-button>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
@ -199,17 +200,19 @@
prop="details" prop="details"
> >
<umyTable <umyTable
ref="inspectNoticeDetails_table_ref"
:setUTableHeight="470" :setUTableHeight="470"
:tableData="inspectNoticeDetailsFormData.details" :tableData="inspectNoticeDetailsFormData.details"
:tableColumns="inspectNoticeDetailsTableColumns" :tableColumns="inspectNoticeDetailsTableColumns"
:tableLoading = "inspectNoticeDetailsTableLoading" :tableLoading = "inspectNoticeDetailsTableLoading"
:isShowIndex="true" :isShowIndex="true"
:selectionTable="false" :selectionTable="true"
:cellClassName="cellClassName" :cellClassName="cellClassName"
:tableBorder="true" :tableBorder="true"
:tableAlign="'center'" :tableAlign="'center'"
:tableHeaderAlign="'center'" :tableHeaderAlign="'center'"
@buttonClick="inspectDetailsButtonClick" @buttonClick="inspectDetailsButtonClick"
@handleSelectionChange="handleSelectDetailZJ"
> >
</umyTable> </umyTable>
</el-form-item> </el-form-item>
@ -274,7 +277,13 @@ import {
InspectSplitPackingk InspectSplitPackingk
} from "@/api/wms-api" } from "@/api/wms-api"
import { postSplitPackingInspect,postInventoryLabelCode_count } from "@/api/wms-core" 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 { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins" import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins" import { drawerMixins } from "@/mixins/drawerMixins"
@ -406,40 +415,9 @@ export default {
// inspectUserName: null, // inspectUserName: null,
// receiveUom: null, // receiveUom: null,
}, },
inspectForm: [ inspectForm: [],
{ type: "input", label: "物品代码", prop: "itemCode", disabled: true, colSpan: 12 }, inspectHandle: [],
{ type: "input", label: "物品名称", prop: "itemName", disabled: true, colSpan: 12 }, inspectRules: {},
{ 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()
}
}
}
],
},
inspectOptions:{}, inspectOptions:{},
inspectDetailsTableColumns:[ inspectDetailsTableColumns:[
{ type: "input", label: "名称", prop: "name", width:'100%' }, { type: "input", label: "名称", prop: "name", width:'100%' },
@ -608,12 +586,84 @@ export default {
name: 'mx', name: 'mx',
} }
], ],
//
isBatchInspect:false,
selectedDetailZJ:[],
}; };
}, },
mounted () { mounted () {
this.paging(); this.paging();
}, },
methods: { 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){ currenDrawerButtonClick(val,index, label,item){
if(item.prop == "inspectReport"){ if(item.prop == "inspectReport"){
@ -689,13 +739,16 @@ export default {
} }
}, },
// //
buttonClick(row) { async buttonClick(row) {
this.summaryCurrentRow = row
// //
if (row.summaryInspectStatus == 2) { if (row.summaryInspectStatus == 2) {
this.$message.error('已完成质检') this.$message.error('已完成质检')
return 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 this.Loading.appMainLoading = true
setTimeout(()=>{ setTimeout(()=>{
@ -750,7 +803,7 @@ export default {
// inspectUserPhone: null, // inspectUserPhone: null,
// stdPackUom: null, // stdPackUom: null,
} }
this.$listAssign(this.inspectNoticeDetailsFormData, row) this.$listAssign(this.inspectNoticeDetailsFormData, this.summaryCurrentRow)
let findRs = this.tableDataDetails.details.filter(item => ( let findRs = this.tableDataDetails.details.filter(item => (
item.itemCode == row.itemCode item.itemCode == row.itemCode
)) ))
@ -809,25 +862,41 @@ export default {
inspectButtonClick(row, index, label) { inspectButtonClick(row, index, label) {
this.inspectFormData.details.splice(row.$index, 1) 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.inspectFormData.inspectQty = null
// this.$refs.inspectForm_Ref.resetCurrenForm() // this.$refs.inspectForm_Ref.resetCurrenForm()
let _detailTable = '[]' let _detailTable = '[]'
if(row.otherPropertyJson && row.otherPropertyJson != '' && row.otherPropertyJson != 'null'){ if(_fleshRow.otherPropertyJson && _fleshRow.otherPropertyJson != '' && _fleshRow.otherPropertyJson != 'null'){
_detailTable = JSON.parse(JSON.stringify(row.otherPropertyJson)) _detailTable = JSON.parse(JSON.stringify(_fleshRow.otherPropertyJson))
} }
this.inspectFormData = row this.inspectFormData = JSON.parse(JSON.stringify(_fleshRow))
this.inspectFormData.details = JSON.parse(_detailTable) this.inspectFormData.details = JSON.parse(_detailTable)
// //
if(row.detailInspectStatus == 1){ if(_fleshRow.detailInspectStatus == 1){
// todo
this.inspectFormData.appearance = '' this.inspectFormData.appearance = ''
this.inspectFormData.volume = '' this.inspectFormData.volume = ''
this.inspectFormData.weight = '' this.inspectFormData.weight = ''
this.inspectFormData.otherPropertyJson = '[]' this.inspectFormData.otherPropertyJson = '[]'
this.inspectFormData.details = [] 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 // - table
inspectDetailsButtonClick(row, index, label) { inspectDetailsButtonClick(row, index, label) {
@ -863,6 +932,8 @@ export default {
}) })
} }
else if (label == '检验') { else if (label == '检验') {
this.isBatchInspect = false
this.initDomIfBatch()
this.rowReceiveQty = row.receiveQty this.rowReceiveQty = row.receiveQty
getListByItemcode({itemCode: row.itemCode}, 'basedata/item-guide-book').then(res => { getListByItemcode({itemCode: row.itemCode}, 'basedata/item-guide-book').then(res => {
if (res.length > 0) { if (res.length > 0) {
@ -873,12 +944,12 @@ export default {
this.blobName = '' this.blobName = ''
if(document.getElementById("uploadPictureCardGuideBook"))document.getElementById("uploadPictureCardGuideBook").innerHTML = '' if(document.getElementById("uploadPictureCardGuideBook"))document.getElementById("uploadPictureCardGuideBook").innerHTML = ''
} }
this.inspectShow = true
this.resetInspectForm(row) this.resetInspectForm(row)
this.inspectShow = true
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
this.inspectShow = true
this.resetInspectForm(row) this.resetInspectForm(row)
this.inspectShow = true
}) })
this.rowId = row.id this.rowId = row.id
} else if (label == '清除检验') { } else if (label == '清除检验') {
@ -888,7 +959,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.inspectNoticeDetailsTableLoading = true this.inspectNoticeDetailsTableLoading = true
setDetailDefaultOkStatus({detailId: this.inspectFormData.id}, this.masterID).then(res => { setDetailDefaultOkStatus({detailId: row.id}, this.masterID).then(res => {
this.$message.success('成功清除检验!') this.$message.success('成功清除检验!')
// ============================================================ // ============================================================
// this.$listAssign(this.inspectNoticeDetailsFormData, res) // 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){ formClick(val){
if (val[0] == 0) { 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 // table
inspectAddTable(val) { inspectAddTable(val) {
this.editFormData = this.inspectFormData this.editFormData = this.inspectFormData
@ -1170,11 +1306,11 @@ export default {
}, },
// //
cellClassName({row, column, rowIndex, columnIndex}){ cellClassName({row, column, rowIndex, columnIndex}){
if (row.detailInspectStatus == 1 && columnIndex === 5) { if (row.detailInspectStatus == 1 && columnIndex === 6) {
return 'cell-class-mrhg' // return 'cell-class-mrhg' //
} else if (row.detailInspectStatus == 2 && columnIndex === 5) { } else if (row.detailInspectStatus == 2 && columnIndex === 6) {
return 'cell-class-hg'// return 'cell-class-hg'//
} else if (row.detailInspectStatus == 3 && columnIndex === 5) { } else if (row.detailInspectStatus == 3 && columnIndex === 6) {
return 'cell-class-nohg'// return 'cell-class-nohg'//
}else{ }else{
return '' return ''

Loading…
Cancel
Save