代码更新

This commit is contained in:
2022-11-07 11:19:57 +08:00
parent ecded8f55d
commit 30f6c9ec14
5 changed files with 8 additions and 362 deletions

View File

@@ -136,8 +136,8 @@
<script>
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/st/inStor/check/AddDtl'
import check from '@/api/wms/st/inStor/check'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import check from '@/views/wms/st/inStor/check/check'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
const defaultForm = {
check_code: '',

View File

@@ -140,8 +140,8 @@
<script>
import CRUD, { crud } from '@crud/crud'
import check from '@/api/wms/st/inStor/check'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import check from '@/views/wms/st/inStor/check/check'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import MaterDialog from '@/views/wms/pub/MaterDialog'
export default {

View File

@@ -121,19 +121,17 @@
<el-table-column prop="check_result" label="盘点结果" align="center" :formatter="check_resultFormat" />
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
</el-table>
<ReCheckDialog ref="child3" @ReCheckChanged="getOutBillDtl" />
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import check from '@/api/wms/st/inStor/check'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import ReCheckDialog from '@/views/wms/st/inStor/check/ReCheckDialog'
import check from '@/views/wms/st/inStor/check/check'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
export default {
name: 'ProcessDialog',
components: { ReCheckDialog },
components: { },
mixins: [crud()],
props: {
dialogShow: {

View File

@@ -1,352 +0,0 @@
<template>
<el-dialog
title="重新盘点"
append-to-body
fullscreen
:visible.sync="dialogVisible"
@open="open"
@close="close"
>
<el-card class="box-card" shadow="never">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="盘点单号" prop="check_code">
<el-input v-model="form.check_code" placeholder="盘点单号" disabled />
</el-form-item>
<el-form-item label="盘点仓位" prop="struct_name">
<el-input v-model="form.struct_name" placeholder="盘点仓位" disabled />
</el-form-item>
<el-form-item label="盘点载具" prop="storagevehicle_code">
<el-input v-model="form.storagevehicle_code" placeholder="盘点单号" disabled />
</el-form-item>
<el-form-item label="明细数" prop="dtl_num">
<el-input v-model="form.dtl_num" style="width: 200px" :disabled="true" />
</el-form-item>
</el-form>
</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
ref="table"
:data="tableData"
style="width: 100%;"
max-height="300"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleCurrentChange"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" width="190" align="center">
<template scope="scope">
<el-input v-show="isCanDel(scope.$index, scope.row,'3')" v-model="scope.row.bucketunique" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryBucket(scope.$index, scope.row)" />
</el-input>
<span v-show="isCanDel(scope.$index, scope.row,'2')">{{ scope.row.bucketunique }}</span>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" align="center" />
<el-table-column prop="material_name" label="物料名称" align="center" />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.quality_scode"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.ST_QUALITY_SCODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px">
<template slot-scope="scope">
<el-select
v-model="scope.row.ivt_level"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.ST_IVT_LEVEL"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="is_active" label="是否可用" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.is_active"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.is_used"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="pcsn" label="批次" align="center" />
<el-table-column prop="ivt_qty" label="库存重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="ivt_qty_ck" label="盘点重量" width="160" align="center">
<template scope="scope">
<el-input-number v-show="!scope.row.edit" v-model="scope.row.ivt_qty_ck" :precision="3" :min="0" />
<span v-show="scope.row.edit">{{ scope.row.ivt_qty_ck }}</span>
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
<el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button :disabled="scope.row.new_edit" 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" 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" 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="process1">确认</el-button>
</span>
<MaterDialog :dialog-show.sync="materShow" @tableChanged2="tableChanged2" />
<BucketDialog :dialog-show.sync="bucketShow" @bucketChange="tableChanged2"/>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import check from '@/api/wms/st/inStor/check'
import BucketDialog from '@/views/wms/st/inStor/moreOrless/NewBucketDialog'
import MaterDialog from '@/views/wms/pub/MaterDialog'
export default {
name: 'ReCheckDialog',
components: { MaterDialog, BucketDialog },
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Object
}
},
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used'],
data() {
return {
dialogVisible: false,
materShow: false,
bucketShow: false,
add_flag: true,
nowrow: null,
nowindex: '',
form: {},
tableData: [],
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
check.getOutBillDis({ 'storagevehicle_code': this.form.storagevehicle_code }).then(res => {
this.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.tableData.length; i++) {
const row = this.tableData[i]
row.new_edit = true
this.tableData.splice(i, 1, row)
}
this.form.dtl_num = this.tableData.length
})
},
close() {
this.$emit('ReCheckChanged')
},
handleCurrentChange(current) {
if (current !== null) {
this.nowrow = current
this.add_flag = false
} else {
this.nowrow = null
this.add_flag = true
}
},
setReForm(row) {
this.dialogVisible = true
this.form = row
},
addrow() {
if (this.nowrow === null) {
this.crud.notify('请先选中一条已存在的盘点明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.tableData.push({ bucketunique: '', storagevehicle_id: this.nowrow.storagevehicle_id, storagevehicle_type: this.nowrow.storagevehicle_type, storagevehicle_code: this.nowrow.storagevehicle_code, material_id: '', material_name: '', ivt_qty: '0', qty_unit_id: '', qty_unit_name: '', pcsn: '', quality_scode: '00', ivt_level: '01', is_active: '1', ivt_qty_ck: '0', edit: false, new_edit: false })
this.form.dtl_num = this.tableData.length
},
async queryMater(index, row) {
this.materShow = true
this.nowindex = index
this.nowrow = row
},
async queryBucket(index, row) {
this.bucketShow = true
this.nowindex = index
this.nowrow = row
},
tableChanged2(row) {
this.nowrow.material_code = row.material_code
this.nowrow.material_id = row.material_id
this.nowrow.material_name = row.material_name
this.nowrow.qty_unit_id = row.qty_unit_id
this.nowrow.qty_unit_name = row.qty_unit_name
this.nowrow.quality_scode = row.quality_scode
this.nowrow.is_active = row.is_active
this.nowrow.ivt_level = row.ivt_level
this.nowrow.pcsn = row.pcsn
this.nowrow.ivt_qty_ck = row.storage_qty
this.nowrow.bucketunique = row.bucketunique
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
isCanDel(index, row, type) {
if (type === '1') {
if (row.new_edit) {
return true
} else {
if (row.edit) {
return true
} else {
return false
}
}
} else if (type === '2') {
if (row.new_edit) {
return true
} else {
if (row.edit) {
return true
} else {
return false
}
}
} else if (type === '3') {
if (row.new_edit) {
return false
} else {
if (row.edit) {
return false
} else {
return true
}
}
}
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
if (!row.edit) {
const num = parseFloat(row.ivt_qty)
const fac_qty = parseFloat(row.ivt_qty_ck)
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
}
if (!row.pcsn) {
this.crud.notify('物料批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.bucketunique) {
this.crud.notify('桶号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.tableData.length; i++) {
if ((this.tableData[i].bucketunique === row.bucketunique) && (index !== i)) {
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
},
process1() {
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.process1({ 'row': this.form, 'rows': this.tableData }).then(res => {
this.dialogVisible = false
})
}
}
}
</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;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -204,7 +204,7 @@ import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/inStor/check/AddDialog'
import CheckDialog from '@/views/wms/st/inStor/check/CheckDialog'
import ProcessDialog from '@/views/wms/st/inStor/check/ProcessDialog'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'