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) {
return request({

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

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

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

@ -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 ''

Loading…
Cancel
Save