opt:优化盘点功能、换标转单出库

This commit is contained in:
zds
2025-07-03 15:33:30 +08:00
parent 563c86cfd1
commit f508e855c0
20 changed files with 1203 additions and 1500 deletions

View File

@@ -9,25 +9,11 @@
@close="close"
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="13" style="border: 1px solid white">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="5">
<el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="库区" prop="gender5">
<el-cascader
placeholder="请选择"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
</el-form>
</el-col>
<el-col :span="6">
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="showLoading" type="primary" @click="allInsert">一键保存</el-button>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
@@ -104,7 +90,6 @@
<div class="crud-opts2">
<span class="role-span">盘点明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
@@ -190,12 +175,6 @@
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150" show-overflow-tooltip />
<el-table-column prop="date_of_production" label="生产日期" v-if="crud.status.view > 0" align="center" min-width="150" show-overflow-tooltip />
<el-table-column prop="remark" v-if="crud.status.view > 0" label="备注" align="center" min-width="150" show-overflow-tooltip />
<!-- <el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" width="200px" >
<template scope="scope">
<el-input v-model="scope.row.remark" size="mini" />
<span>{{ scope.row.remark }}</span>
</template>
</el-table-column>-->
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
@@ -260,7 +239,6 @@ export default {
sectProp: null,
stor_id: '',
sect_id: '',
sects: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
@@ -283,9 +261,6 @@ export default {
crudUserStor.getUserStor().then(res => {
this.storlist = res
})
crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
},
close() {
this.$emit('AddChanged')
@@ -293,23 +268,11 @@ export default {
[CRUD.HOOK.afterToEdit]() {
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToView]() {
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
queryDtlCheck(type) {
@@ -392,30 +355,6 @@ export default {
this.paramDtlView = row.storagevehicle_code
this.dtlViewShow = true
},
allInsert() {
if (this.form.check_type === '') {
this.crud.notify('请选择盘点单类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.form.stor_id === '') {
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.sect_id === '' && this.stor_id === '') {
this.crud.notify('请选择库区或者仓库!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.showLoading = true
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
debugger
check.allInsert(this.form).then(res => {
this.crud.cancelCU()
this.showLoading = false
}).catch(() => {
this.showLoading = false
})
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
@@ -427,22 +366,6 @@ export default {
})
}
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.stor_id = val[0]
this.sect_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.stor_id = ''
}
if (val.length === 2) {
this.stor_id = val[0]
this.sect_id = val[1]
}
this.form.stor_id = this.stor_id
},
repairDialog() {
this.check_code = this.form.check_code
this.repairShow = true

View File

@@ -69,22 +69,6 @@
</el-card>
<div class="crud-opts2">
<span class="role-span">盘点明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
:disabled="add_flag"
@click="addrow"
>
新增一行
</el-button>-->
</span>
</div>
<!--表格渲染-->
<el-table
@@ -132,18 +116,10 @@
<el-input v-model="scope.row.remark" size="mini" style="width: 250px" />
</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button :disabled="isCanDel(scope.$index, scope.row,1)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, tableData)" />
<el-button v-show="!scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button v-show="scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
</template>
</el-table-column>-->
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<!-- <el-button type="primary" @click="saveCheck">保存</el-button>-->
<el-button type="primary" @click="submitCheck">确认</el-button>
</span>
<MaterDialog :dialog-show.sync="materShow" @tableChanged2="tableChanged2" />
@@ -244,67 +220,6 @@ export default {
this.add_flag = true
}
},
isCanDel(index, row, type) {
if (type === 1) {
if (row.status === '1') {
return false
} else {
return true
}
}
},
isShow(index, row, type) {
const num = parseFloat(row.base_qty)
if (type === 1) {
if (row.status > '3') {
return false
} else {
if (num > 0) {
return false
} else {
if (row.edit) {
return false
} else {
return true
}
}
}
} else if (type === 2) {
if (row.status > '2') {
return false
} else {
if (row.edit) {
return false
} else {
return true
}
}
} else if (type === 3) {
if (row.status > '3') {
return true
} else {
if (num > 0) {
return true
} else {
if (row.edit) {
return true
} else {
return false
}
}
}
} else if (type === 4) {
if (row.status > '2') {
return true
} else {
if (row.edit) {
return true
} else {
return false
}
}
}
},
setForm(row) {
this.dialogVisible = true
this.form = row
@@ -312,22 +227,6 @@ export default {
bill_statusFormat(row, column) {
return this.dict.label.check_dtl_status[row.status]
},
check_resultFormat(row, column) {
return this.dict.label.check_result[row.check_result]
},
addrow() {
if (this.nowrow === null) {
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.tableData.push({ check_id: this.form.check_id, check_code: this.form.check_code, checkdtl_id: '', sect_id: this.nowrow.sect_id, sect_name: this.nowrow.sect_name, struct_id: this.nowrow.struct_id, struct_name: this.nowrow.struct_name, storagevehicle_id: this.nowrow.storagevehicle_id, storagevehicle_code: this.nowrow.storagevehicle_code, status: '01', material_id: '', material_name: '', base_qty: '0', qty_unit_id: '42', qty_unit_name: '桶', is_down: '0', fac_qty: '', check_result: '0', edit: false })
this.form.dtl_num = this.tableData.length
},
async queryMater(index, row) {
this.materShow = true
this.nowindex = index
this.nowrow = row
},
tableChanged2(row) {
for (let i = 0; i < this.tableData.length; i++) {
if ((this.tableData[i].material_id === row.material_id) && (this.tableData[i].storagevehicle_code === this.nowrow.storagevehicle_code) && (this.tableData[i].struct_id === this.nowrow.struct_id)) {
@@ -340,29 +239,6 @@ export default {
this.nowrow.material_name = row.material_name
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
if (!row.edit) {
const num = parseFloat(row.base_qty)
const fac_qty = parseFloat(row.fac_qty)
if (num <= 0 && fac_qty <= 0) {
this.crud.notify('不允许新增明细,盘点数量为0', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.material_id) {
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
row.edit = !row.edit
this.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
},
deleteRow(index, rows) {
rows.splice(index, 1)
this.nowindex = ''
this.nowrow = null
this.form.detail_count = this.tableData.length
},
submitCheck() {
check.confirm({ 'row': this.form, 'rows': this.tableData }).then(res => {
this.dialogVisible = false
@@ -370,21 +246,6 @@ export default {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
saveCheck() {
if (this.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.tableData.length; i++) {
if (!this.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false
}
}
check.saveCheck({ 'row': this.form, 'rows': this.tableData }).then(res => {
this.dialogVisible = false
})
},
openDtlView(row) {
this.paramDtlView = row.storagevehicle_code
this.dtlViewShow = true

View File

@@ -8,7 +8,7 @@
destroy-on-close
@close="close"
>
<el-form ref="form" :model="form1" :rules="rules" size="mini" label-width="110px">
<el-form ref="form" :model="form1" size="mini" label-width="110px">
<el-form-item label="箱号:" prop="storagevehicle_code">
<el-input v-model="form1.storagevehicle_code" style="width: 250px;" />
</el-form-item>
@@ -37,7 +37,7 @@ import CRUD, { header, presenter } from '@crud/crud'
import check from '@/views/wms/st/inStor/check/check'
export default {
name: 'ProcessDialog',
name: 'RepairDialog',
mixins: [presenter(), header()],
props: {
dialogShow: {

View File

@@ -38,19 +38,6 @@ export function getOutBillDtl2(params) {
params
})
}
export function getOutBillDis(params) {
return request({
url: '/api/check/getOutBillDis',
method: 'get',
params
})
}
export function getInvTypes() {
return request({
url: '/api/check/getInvTypes',
method: 'get'
})
}
export function insertDtl(data) {
return request({
url: '/api/check/insertDtl',
@@ -80,27 +67,6 @@ export function handdown(data) {
data
})
}
export function saveCheck(data) {
return request({
url: '/api/check/saveCheck',
method: 'post',
data
})
}
export function process0(data) {
return request({
url: '/api/check/process0',
method: 'post',
data
})
}
export function process1(data) {
return request({
url: '/api/check/process1',
method: 'post',
data
})
}
export function disposeConfirm(data) {
return request({
url: '/api/check/disposeConfirm',
@@ -108,13 +74,7 @@ export function disposeConfirm(data) {
data
})
}
export function allInsert(data) {
return request({
url: '/api/check/allInsert',
method: 'post',
data
})
}
export function confirmBtn(data) {
return request({
url: '/api/check/confirmBtn',
@@ -129,4 +89,4 @@ export function repairSubmit(data) {
data
})
}
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1, disposeConfirm, allInsert, confirmBtn, repairSubmit }
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, disposeConfirm, confirmBtn, repairSubmit }

View File

@@ -288,7 +288,6 @@ export default {
return row.status !== '1'
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.buss_type = ''
this.handleCurrentChange(null)
},
handleSelectionChange(val, row) {
@@ -354,11 +353,6 @@ export default {
this.$refs.child.setForm(this.currentRow)
}
},
confirm() {
if (this.currentRow !== null) {
this.$refs.child2.setForm(this.currentRow)
}
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true

View File

@@ -58,7 +58,7 @@
<el-option
v-for="item in dict.ST_INV_OUT_TYPE"
:key="item.value"
:disabled="item.value === '1099'"
:disabled="item.value === '1099' || item.value === '1020'"
:label="item.label"
:value="item.value"
/>