add:盘点管理

This commit is contained in:
2025-08-28 16:21:37 +08:00
parent 6566d8e2be
commit b9ec1bc7c7
16 changed files with 696 additions and 120 deletions

View File

@@ -39,7 +39,7 @@
<el-col :span="8">
<el-form-item label="焊材批号" prop="pcsn">
<el-input v-model="formMst.pcsn" disabled placeholder="由系统自动生成" style="width: 200px;" />
<el-input v-model="formMst.pcsn" style="width: 200px;" />
</el-form-item>
</el-col>

View File

@@ -237,13 +237,19 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="是否临时" prop="is_tempstruct">
<el-radio v-model="form.is_tempstruct" label="1">是</el-radio>
<el-radio v-model="form.is_tempstruct" label="0">否</el-radio>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否空载具" prop="is_emptyvehicle">
<el-radio v-model="form.is_emptyvehicle" label="1">是</el-radio>
<el-radio v-model="form.is_emptyvehicle" label="0">否</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">

View File

@@ -124,6 +124,7 @@
<el-table-column prop="base_qty" label="库存数量" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('base_qty',crud.data,'库存数量')" />
<el-table-column v-if="crud.status.view > 0" prop="fac_qty" label="盘点数量" align="center" :formatter="crud.formatNum3" :min-width="flexWidth('fac_qty',crud.data,'盘点数量')" />
<el-table-column prop="qty_unit_name" label="计量单位" align="center" :min-width="flexWidth('input_time',crud.data,'创建日期')" />
<el-table-column v-if="crud.status.view > 0" prop="task_code" label="移出任务编码" align="center" :min-width="flexWidth('task_code',crud.data,'移出任务编码')" />
<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)" />

View File

@@ -103,7 +103,7 @@ export default {
return CRUD({
title: '库存物料',
optShow: {},
url: 'api/moveStor/getCanuseIvt',
url: 'api/checkoutbill/getCanuseIvt',
idField: 'struct_id',
sort: 'storagevehicleext_id,desc'
})

View File

@@ -7,6 +7,17 @@
@open="open"
@close="close"
>
<el-row style="padding-bottom: 10px" :gutter="20">
<el-col :span="22" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="2">
<span>
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</el-col>
</el-row>
<el-card class="box-card" shadow="never">
<el-form ref="form1" :inline="true" :model="form1" :rules="rules" size="mini" label-width="80px">
<el-input v-show="false" v-model="form1.stor_code" placeholder="仓库编码" />
@@ -67,18 +78,13 @@
</el-form-item>
</el-form>
</el-card>
<div class="crud-opts2">
<div style="padding-bottom: 10px;padding-top: 10px">
<span class="role-span">盘点明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
</span>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="form1.tableData"
:data="tableData"
style="width: 100%;"
max-height="300"
border
@@ -92,29 +98,24 @@
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
<el-table-column prop="material_code" label="物料编码" align="center" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" align="center" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="pcsn" label="批次" align="center" :min-width="flexWidth('pcsn',crud.data,'批次')" />
<el-table-column prop="base_qty" label="库存数量" :formatter="crud.formatNum3" align="center" :min-width="flexWidth('base_qty',crud.data,'库存数量')" />
<el-table-column prop="fac_qty" label="盘点数量" align="center" :min-width="flexWidth('fac_qty',crud.data,'盘点数量')">
<template scope="scope">
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :precision="3" :min="0" :disabled="scope.row.status === '99'" />
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :controls="false" :precision="3" :min="0" :disabled="scope.row.status === '99'" />
<span v-show="isShow(scope.$index, scope.row,4)">{{ scope.row.fac_qty }}</span>
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="计量单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'计量单位')" />
<el-table-column prop="task_code" label="移出任务编码" align="center" :min-width="flexWidth('task_code',crud.data,'移出任务编码')" />
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('status',crud.data,'状态')" />
<el-table-column align="center" label="操作" fixed="right">
<el-table-column align="center" :width="200" label="操作" fixed="right">
<template scope="scope">
<el-button v-if="false" :disabled="isCanDel(scope.$index, scope.row,1)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.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>
<el-button :disabled="!scope.row.edit" type="success" class="filter-item" size="mini" @click="dtlCheckConfirm(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>
</el-dialog>
</template>
@@ -132,9 +133,6 @@ export default {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Object
}
@@ -147,6 +145,7 @@ export default {
nowrow: null,
nowindex: '',
storlist: [],
tableData: [],
form1: {
check_id: '',
check_code: '',
@@ -168,31 +167,27 @@ export default {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
this.form1 = this.openParam
}
}
},
methods: {
open() {
this.getDtl()
// 查询原材料库的仓库
crudStorattr.getStor({}).then(res => {
this.storlist = res
})
check.getDtl({ 'check_id': this.form1.check_id }).then(res => {
this.form1.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form1.tableData.length; i++) {
const row = this.form1.tableData[i]
row.edit = false
if (row.status > '20') {
row.edit = true
}
this.$set(this.form1.tableData, i, row)
}
})
this.$forceUpdate()
},
close() {
this.$emit('AddChanged')
this.$refs['form1'].resetFields()
this.$emit('update:dialogShow', false)
this.crud.toQuery()
},
getDtl() {
check.getDtl({ 'check_id': this.form1.check_id }).then(res => {
this.tableData = res
})
},
handleCurrentChange(current) {
if (current !== null) {
@@ -276,10 +271,6 @@ export default {
}
}
},
setForm(row) {
this.dialogVisible = true
this.form1 = row
},
bill_statusFormat(row, column) {
return this.dict.label.CHECK_DTL_STATUS[row.status]
},
@@ -300,29 +291,10 @@ export default {
row.edit = !row.edit
this.form1.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
},
deleteRow(index, rows) {
rows.splice(index, 1)
this.nowindex = ''
this.nowrow = null
this.form1.detail_count = this.form1.tableData.length
},
saveCheck() {
if (this.form1.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form1.tableData.length; i++) {
if (!this.form1.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false
}
if (this.form1.tableData[i].fac_qty === '' || this.form1.tableData[i].fac_qty === 0) {
this.crud.notify('盘点数量不能为0序号' + (i + 1) + ',请检查!')
return false
}
}
check.saveCheck(this.form1).then(res => {
this.dialogVisible = false
dtlCheckConfirm(index, row) {
check.dtlCheckConfirm(row).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.getDtl()
})
}
}
@@ -330,14 +302,4 @@ export default {
</script>
<style>
.crud-opts2 {
padding: 0 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
padding: 4px 4px;
}
</style>

View File

@@ -46,11 +46,21 @@ export function confirm(data) {
data
})
}
export function saveCheck(data) {
export function sendMoveTask(data) {
return request({
url: '/api/check/saveCheck',
url: '/api/check/sendMoveTask',
method: 'post',
data
})
}
export default { add, edit, del, getDtl, getStructIvt, confirm, saveCheck }
export function dtlCheckConfirm(data) {
return request({
url: '/api/check/dtlCheckConfirm',
method: 'post',
data
})
}
export default { add, edit, del, getDtl, getStructIvt, confirm, sendMoveTask, dtlCheckConfirm }

View File

@@ -108,6 +108,17 @@
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="check_flag"
icon="el-icon-position"
size="mini"
@click="sendMoveTask"
>
下发移库
</el-button>
<el-button
slot="right"
class="filter-item"
@@ -119,7 +130,7 @@
>
盘点
</el-button>
<el-button
<!-- <el-button
slot="right"
class="filter-item"
type="success"
@@ -129,7 +140,7 @@
@click="submitCheck"
>
确认
</el-button>
</el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
@@ -182,7 +193,7 @@
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<CheckDialog ref="child" @AddChanged="querytable" />
<CheckDialog ref="child" :dialog-show.sync="openCheck" :open-param="openParam" @AddChanged="querytable" />
</div>
</template>
@@ -217,7 +228,7 @@ export default {
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['CHECK_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_TYPE_CK'],
dicts: ['CHECK_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_TYPE_CK', 'check_result'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
@@ -227,6 +238,8 @@ export default {
del: ['admin', 'check:del']
},
check_flag: true,
openParam: null,
openCheck: false,
downdtl_flag: true,
confirm_flag: true,
currentRow: null,
@@ -293,11 +306,7 @@ export default {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
is_nokFormat(row) {
if (row.is_nok === '1') {
return '异常'
} else {
return '正常'
}
return this.dict.label.check_result[row.is_nok]
},
handleCurrentChange(current) {
if (current === null) {
@@ -310,9 +319,16 @@ export default {
checkboxT(row) {
return row.bill_status !== '99'
},
sendMoveTask() {
check.sendMoveTask(this.currentRow).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
checkOpen() {
if (this.currentRow !== null) {
this.$refs.child.setForm(this.currentRow)
this.openParam = this.currentRow
this.openCheck = true
}
},
confirm() {