修改
This commit is contained in:
522
lms/nladmin-ui/src/views/wms/st/inStor/change/AddDialog.vue
Normal file
522
lms/nladmin-ui/src/views/wms/st/inStor/change/AddDialog.vue
Normal file
@@ -0,0 +1,522 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<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>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form
|
||||
ref="form"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
size="mini"
|
||||
label-width="85px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bill_type">
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
placeholder="业务类型"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CG"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.move_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务日期" prop="biz_date">
|
||||
<el-date-picker
|
||||
v-model="form.biz_date"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 210px"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
style="width: 380px;"
|
||||
rows="2"
|
||||
type="textarea"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">移库明细</span>
|
||||
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
添加库存物料
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column key="1" type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column
|
||||
v-if="crud.status.add!==1"
|
||||
key="2"
|
||||
prop="work_status"
|
||||
label="状态"
|
||||
align="center"
|
||||
:formatter="bill_statusFormat"
|
||||
/>
|
||||
<el-table-column key="3" show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
|
||||
<el-table-column key="4" prop="material_name" label="物料名称" align="center" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column key="5" prop="pcsn" label="批次号" align="center" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
key="10"
|
||||
show-overflow-tooltip
|
||||
prop="qty"
|
||||
label="重量"
|
||||
:formatter="crud.formatNum3"
|
||||
width="120"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column key="11" show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column key="12" show-overflow-tooltip prop="turnout_sect_name" label="库区" />
|
||||
<el-table-column key="14" show-overflow-tooltip prop="turnout_struct_code" label="货位" />
|
||||
<el-table-column key="15" width="150" show-overflow-tooltip prop="sale_order_name" label="销售订单行号-旧" />
|
||||
<el-table-column key="16" width="150" show-overflow-tooltip prop="new_sale_order_name" label="销售订单行号-新">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.new_sale_order_name" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.new_sale_order_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="17" width="150" show-overflow-tooltip prop="customer_name" label="客户编码-旧" />
|
||||
<el-table-column key="18" width="150" show-overflow-tooltip prop="customer_description" label="客户名称-旧" />
|
||||
<el-table-column key="19" width="150" show-overflow-tooltip prop="new_customer_name" label="客户编码-新">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.new_customer_name" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.new_customer_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="20" width="150" show-overflow-tooltip prop="new_customer_description" label="客户名称-新" >
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.new_customer_description" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.new_customer_description }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="21" width="150" show-overflow-tooltip prop="demand_date" label="交货日期-新">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.demand_date" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.demand_date }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="21" width="150" show-overflow-tooltip prop="date_of_FG_inbound" label="制作日期-新">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.date_of_FG_inbound" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.date_of_FG_inbound }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="22" width="150" show-overflow-tooltip prop="isRePrintPackageBoxLabel" label="更换外包装标签">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.isRePrintPackageBoxLabel" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.isRePrintPackageBoxLabel }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="23" width="150" show-overflow-tooltip prop="isUnPackBox" label="更换子卷标签">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.isUnPackBox" class="input-with-select">
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.isUnPackBox }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" key="25" 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)"
|
||||
/>
|
||||
<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>
|
||||
<AddDtl :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
|
||||
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/st/inStor/change/AddDtl'
|
||||
import handmovestor from '@/views/wms/st/inStor/change/change'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import StructDiv from '@/views/wms/pub/StructDialog'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
bill_status: '10',
|
||||
total_qty: '0',
|
||||
detail_count: '0',
|
||||
bill_type: '2002',
|
||||
remark: '',
|
||||
biz_date: new Date(),
|
||||
create_mode: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { AddDtl, StructDiv },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['move_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable', 'ST_INV_TYPE_CG', 'work_status'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
structShow: false,
|
||||
structShow2: false,
|
||||
flagnow: false,
|
||||
nowrow: {},
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
invtypelist: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
],
|
||||
bill_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
biz_date: [
|
||||
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
debugger
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
handmovestor.getOutBillDtl({ 'moveinv_id': this.form.moveinv_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]() {
|
||||
debugger
|
||||
handmovestor.getOutBillDtl({ 'moveinv_id': this.form.moveinv_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)
|
||||
}
|
||||
})
|
||||
},
|
||||
bill_statusFormat(row) {
|
||||
debugger
|
||||
return this.dict.label.work_status[row.work_status]
|
||||
},
|
||||
quality_scodeFormat(row) {
|
||||
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
|
||||
},
|
||||
ivt_levelFormat(row) {
|
||||
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
|
||||
},
|
||||
is_activeFormat(row) {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
},
|
||||
storChange(row) {
|
||||
this.storlist.forEach((item) => {
|
||||
if (item.stor_id === row) {
|
||||
this.form.stor_code = item.stor_code
|
||||
this.form.stor_name = item.stor_name
|
||||
}
|
||||
})
|
||||
},
|
||||
async queryDtl() {
|
||||
this.dtlShow = true
|
||||
},
|
||||
async queryStruct(index, row) {
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(false)
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
rows.forEach((item) => {
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].stockrecord_id === item.stockrecord_id) {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
this.$set(item, 'edit', false)
|
||||
this.$set(item, 'work_status', '10')
|
||||
this.$set(item, 'turnin_sect_id', '')
|
||||
this.$set(item, 'turnin_struct_id', '')
|
||||
this.$set(item, 'turnin_sect_code', '')
|
||||
this.$set(item, 'turnin_sect_name', '')
|
||||
this.$set(item, 'turnin_struct_code', '')
|
||||
this.$set(item, 'turnin_struct_name', '')
|
||||
tablemap.set(item.stockrecord_id, item)
|
||||
}
|
||||
} else {
|
||||
this.$set(item, 'edit', false)
|
||||
this.$set(item, 'work_status', '10')
|
||||
this.$set(item, 'turnin_sect_id', '')
|
||||
this.$set(item, 'turnin_struct_id', '')
|
||||
this.$set(item, 'turnin_sect_code', '')
|
||||
this.$set(item, 'turnin_sect_name', '')
|
||||
this.$set(item, 'turnin_struct_code', '')
|
||||
this.$set(item, 'turnin_struct_name', '')
|
||||
tablemap.set(item.stockrecord_id, item)
|
||||
}
|
||||
})
|
||||
for (const value of tablemap.values()) {
|
||||
this.form.tableData.push(value)
|
||||
}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
structChanged(row) {
|
||||
debugger
|
||||
let structflag = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if ((this.form.tableData[i].turnin_struct_id === row.struct_id) || (this.form.tableData[i].turnout_struct_id === row.struct_id)) {
|
||||
structflag = true
|
||||
}
|
||||
}
|
||||
if (structflag) {
|
||||
this.crud.notify('该货位已被设置,不允许重复设置!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].storagevehicle_code === this.nowrow.storagevehicle_code) {
|
||||
this.form.tableData[i].turnin_struct_id = row.struct_id
|
||||
this.form.tableData[i].turnin_struct_code = row.struct_code
|
||||
this.form.tableData[i].turnin_struct_name = row.struct_name
|
||||
|
||||
this.form.tableData[i].turnin_sect_id = row.sect_id
|
||||
this.form.tableData[i].turnin_sect_code = row.sect_code
|
||||
this.form.tableData[i].turnin_sect_name = row.sect_name
|
||||
this.form.tableData.splice(i, 1, this.form.tableData[i]) // 通过splice 替换数据 触发视图更新
|
||||
}
|
||||
}
|
||||
console.log(this.form.tableData)
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (!row.edit) {
|
||||
/*if (row.turnin_struct_id === '') {
|
||||
this.crud.notify('请先选择载具:' + row.storagevehicle_code + '的移入货位!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}*/
|
||||
}
|
||||
row.edit = !row.edit
|
||||
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
if (row.edit) {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.qty)
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = {}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (!this.form.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return 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>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
196
lms/nladmin-ui/src/views/wms/st/inStor/change/AddDtl.vue
Normal file
196
lms/nladmin-ui/src/views/wms/st/inStor/change/AddDtl.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="库存物料选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
width="1300px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<!-- 搜索 -->
|
||||
<el-cascader
|
||||
placeholder="库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="货位号模糊查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="query.remark"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="turnout_sect_name" label="库区" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="turnout_struct_code" label="货位" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" />
|
||||
<el-table-column show-overflow-tooltip prop="sale_order_name" width="150px" label="销售订单及批次" />
|
||||
<el-table-column show-overflow-tooltip prop="customer_name" label="客户编码" />
|
||||
<el-table-column show-overflow-tooltip prop="customer_description" label="客户描述" />
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="重量" :formatter="crud.formatNum3" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
<el-button slot="left" type="primary" @click="submit">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/handmovestor/getStructIvt',
|
||||
query: {
|
||||
struct_code: '',
|
||||
remark: '',
|
||||
sect_id: '',
|
||||
stor_id: ''
|
||||
},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
dicts: ['ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
opendtlParam: '',
|
||||
sects: [],
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
quality_scodeFormat(row, column) {
|
||||
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
|
||||
},
|
||||
ivt_levelFormat(row, column) {
|
||||
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
|
||||
},
|
||||
is_activeFormat(row, column) {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.crud.query.stor_id = val[0]
|
||||
this.crud.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.crud.query.sect_id = ''
|
||||
this.crud.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.crud.query.stor_id = val[0]
|
||||
this.crud.query.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选物料')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
68
lms/nladmin-ui/src/views/wms/st/inStor/change/change.js
Normal file
68
lms/nladmin-ui/src/views/wms/st/inStor/change/change.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/change',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/change/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/change',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getOutBillDtl(params) {
|
||||
return request({
|
||||
url: '/api/change/getOutBillDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getInvTypes() {
|
||||
return request({
|
||||
url: '/api/change/getInvTypes',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function insertDtl(data) {
|
||||
return request({
|
||||
url: '/api/change/insertDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getStructIvt(params) {
|
||||
return request({
|
||||
url: '/api/change/getStructIvt',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/change/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function handdown(data) {
|
||||
return request({
|
||||
url: '/api/change/handdown',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getOutBillDtl, getStructIvt, confirm, getInvTypes, handdown }
|
||||
308
lms/nladmin-ui/src/views/wms/st/inStor/change/index.vue
Normal file
308
lms/nladmin-ui/src/views/wms/st/inStor/change/index.vue
Normal file
@@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="变更单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料查询">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="物料名称、物料编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生成方式">
|
||||
<el-select
|
||||
v-model="query.create_mode"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="生成方式"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_CREATE_MODE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.move_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="query.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_MV"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
:disabled="confirm_flag"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="confirm"
|
||||
>
|
||||
库存变更
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
:highlight-current-row="true"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column
|
||||
v-permission="['admin','checkoutbill:del','checkoutbill:edit']"
|
||||
label="操作"
|
||||
width="160"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :selectable="checkboxT" type="selection" />
|
||||
<el-table-column prop="bill_code" label="单据号" :min-width="flexWidth('bill_code',crud.data,'单据号')">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="stateFormat" prop="bill_status" label="单据状态" :min-width="flexWidth('bill_status',crud.data,'单据状态')"/>
|
||||
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')"/>
|
||||
<el-table-column prop="bill_type" :formatter="bill_typeFormat" label="业务类型" :min-width="flexWidth('bill_type',crud.data,'业务类型')"/>
|
||||
<el-table-column prop="biz_date" label="业务日期" :min-width="flexWidth('biz_date',crud.data,'业务日期')"/>
|
||||
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" :min-width="flexWidth('create_mode',crud.data,'生成方式')"/>
|
||||
<el-table-column label="明细数" prop="detail_count" :min-width="flexWidth('detail_count',crud.data,'明细数')"/>
|
||||
<el-table-column prop="input_time" label="创建日期" :min-width="flexWidth('input_time',crud.data,'创建日期')"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import change from '@/views/wms/st/inStor/change/change'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/st/inStor/change/AddDialog'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
|
||||
export default {
|
||||
name: 'Change',
|
||||
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '库存变更', idField: 'moveinv_id', url: 'api/change', crudMethod: { ...change },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['move_bill_status', 'ST_CREATE_MODE', 'ST_INV_TYPE_CG'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'handmovestor:add'],
|
||||
edit: ['admin', 'handmovestor:edit'],
|
||||
del: ['admin', 'handmovestor:del']
|
||||
},
|
||||
work_flag: true,
|
||||
confirm_flag: true,
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
storlist: []
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '10'
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.buss_type = ''
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.move_bill_status[row.bill_status]
|
||||
},
|
||||
bill_typeFormat(row) {
|
||||
return this.dict.label.ST_INV_TYPE_CG[row.bill_type]
|
||||
},
|
||||
create_modeFormat(row) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
}else{
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
buttonChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
if (current.bill_status === '10') {
|
||||
this.work_flag = false
|
||||
} else {
|
||||
this.work_flag = true
|
||||
}
|
||||
if (current.bill_status !== '99') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current === null) {
|
||||
this.confirm_flag = true
|
||||
this.work_flag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.bill_status !== '99'
|
||||
},
|
||||
confirm() {
|
||||
change.confirm({ 'changeinv_id': this.currentRow.changeinv_id }).then(res => {
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user