add:成品库移库任务

This commit is contained in:
zhangzhiqiang
2023-09-11 09:24:11 +08:00
parent 9ece4e9113
commit 665ac256b9
31 changed files with 2004 additions and 70 deletions

View File

@@ -39,16 +39,16 @@
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="synchronize()"
>
同步
</el-button>
<!-- <el-button-->
<!-- slot="right"-->
<!-- class="filter-item"-->
<!-- type="success"-->
<!-- icon="el-icon-position"-->
<!-- size="mini"-->
<!-- @click="synchronize()"-->
<!-- >-->
<!-- 同步-->
<!-- </el-button>-->
<el-button
slot="right"
class="filter-item"

View File

@@ -0,0 +1,345 @@
<!--suppress ALL -->
<template>
<el-dialog
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">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</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="buss_type">
<el-select
v-model="form.buss_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.cu > 1"
>
<el-option
v-for="item in dict.ST_INV_MOVE_TYPE"
: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
>
<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="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input
v-model.trim="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>
<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"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column prop="seq_no" label="序号" width="50" align="center" />
<el-table-column prop="turnout_sect_name" label="移库库区" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
<el-table-column prop="qty" label="数量" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column prop="turnout_struct_code" label="移出货位" align="center" />
<el-table-column prop="turnin_struct_code" label="移入货位" align="center" >
<template slot-scope="scope">
<el-input v-show="isedit" v-model="scope.row.turnin_struct_code" clearable style="width: 150px" @clear="scope.row.turnin_struct_code='',scope.row.turnin_struct_name=''">
<el-button slot="append" icon="el-icon-plus" @click="queryStruct(scope.$index,scope.row)" ></el-button>
</el-input>
<span v-show="!isedit">{{ scope.row.turnin_struct_code }}</span>
</template>
</el-table-column>
<el-table-column prop="task_code" label="任务编号" align="center" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="100" 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)"
/>
</template>
</el-table-column>
</el-table>
<AddDtl :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
<AddStruct :dialog-show.sync="structShow" @structChanged="structChanged" />
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/storage_manage/product/productCheck/StructIvt'
import AddStruct from '@/views/wms/storage_manage/product/moveInv/AddStruct'
import moveInv from '@/views/wms/storage_manage/product/moveInv/moveInv'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
status: '10',
dtl_num: '0',
buss_type: '',
remark: '',
isedit: false,
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { AddDtl,AddStruct },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
dicts: ['MOVE_BILL_STATUS', 'ST_INV_MOVE_TYPE', 'check_dtl_status', 'product_area'],
data() {
return {
dialogVisible: false,
dtlShow: false,
structShow: false,
flagnow: false,
nowrow: {},
nowindex: '',
storlist: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
],
check_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
this.isedit = true
moveInv.getMoveDtl({ 'moveinv_id': this.form.moveinv_id }).then(res => {
this.form.tableData = res.content
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToAdd]() {
this.isedit = true
},
[CRUD.HOOK.afterToView]() {
this.isedit = false
moveInv.getMoveDtl({ 'moveinv_id': this.form.moveinv_id }).then(res => {
this.form.tableData = res.content
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
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.nowindex = index
this.nowrow = row
this.structShow = true
},
structChanged(rows){
console.log(rows[0].struct_code)
this.$set(this.nowrow,'turnin_struct_code',rows[0].struct_code)
this.$set(this.nowrow,'turnin_struct_name',rows[0].struct_name)
this.$set(this.nowrow,'turnin_struct_id',rows[0].struct_id)
this.form.tableData.splice(this.nowindex, 1, this.nowrow)
},
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].struct_code === item.struct_code) && (this.form.tableData[i].material_code === item.material_code)) {
this.flagnow = true
}
}
if (!this.flagnow) {
item.status = '01'
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
}
} else {
item.status = '01'
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
}
})
for (const value of tablemap.values()) {
value.base_qty = value.canuse_qty
this.form.tableData.push(value)
}
this.form.dtl_num = this.form.tableData.length
},
deleteRow(index, rows) {
rows.splice(index, 1)
this.nowindex = ''
this.nowrow = {}
this.form.dtl_num = this.form.tableData.length
},
[CRUD.HOOK.beforeSubmit]() {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
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;
}
</style>

View File

@@ -0,0 +1,173 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
@close="close"
@open="open"
>
<el-row>
<el-col :span="6">
<!-- 搜索 -->
<el-cascader
placeholder="库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="6">
<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="6">
<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="6">
<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="sect_name" label="库区" width="110px" />
<el-table-column show-overflow-tooltip prop="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="base_qty" label="桶数" :formatter="crud.formatNum0" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="计量单位" />
<el-table-column show-overflow-tooltip prop="storage_qty" :formatter="crud.formatNum3" label="重量" width="110px" />
</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 '@/api/wms/basedata/st/sectattr'
export default {
name: 'AddDtl',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/check/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
}
},
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)
},
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>

View File

@@ -0,0 +1,181 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库位选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
@close="close"
@open="open"
>
<el-row>
<!-- <el-col :span="6">-->
<!-- &lt;!&ndash; 搜索 &ndash;&gt;-->
<!-- <el-cascader-->
<!-- placeholder="库区"-->
<!-- :options="sects"-->
<!-- :props="{ checkStrictly: true }"-->
<!-- clearable-->
<!-- @change="sectQueryChange"-->
<!-- />-->
<!-- </el-col>-->
<el-col :span="6">
<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="6">-->
<!-- <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="6">
<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="stor_name" label="仓库" width="110px" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" width="110px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="is_used" :formatter="formatBoolean" label="是否启用" width="110px" />
<el-table-column show-overflow-tooltip prop="lock_type" label="锁定类型" width="150px" />
</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 '@/api/wms/basedata/st/sectattr'
export default {
name: 'AddStruct',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '仓位', idField: 'struct_id', url: '/api/structattr',
query: {
struct_code: '',
remark: '',
sect_id: '1528631043496742912',
stor_id: '1528627995269533696'
},
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
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)
},
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]
}
},
formatBoolean: function(row, column) {
var ret = ''
if (row[column.property] === true) {
ret = '是' // 根据自己的需求设定
} else {
ret = '否'
}
return ret
},
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('structChanged', this.rows)
}
}
}
</script>

View File

@@ -0,0 +1,232 @@
<template>
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
append-to-body
:visible.sync="dialogVisible2"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<span slot="title" class="dialog-footer">
<div class="crud-opts2">
<span class="el-dialog__title2">移库单任务操作</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button slot="left" type="info" @click="dialogVisible2 = false">关闭</el-button>
</span>
</div>
</span>
<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="warning"
icon="el-icon-check"
size="mini"
@click="sendTask()"
>
下发
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="confirmTask()"
>
强制完成
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="delTask()"
>
取消任务
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="this.openParam"
style="width: 100%;"
max-height="300"
border
highlight-current-row
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
>
<el-table-column prop="seq_no" label="序号" width="50" align="center" />
<el-table-column prop="turnout_sect_name" label="移库库区" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
<el-table-column prop="qty" label="数量" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column prop="turnout_struct_code" label="移出货位" align="center" />
<el-table-column prop="turnin_struct_code" label="移入货位" align="center" />
<el-table-column prop="task_code" label="任务编号" align="center" />
<el-table-column prop="task_status" label="任务状态" align="center" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
export default {
name: 'MoveTaskDialog',
components: {},
mixins: [crud()],
dicts: ['SCH_TASK_TYPE_DTL', 'task_status', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible2: false,
dis_row: null,
dis_del: true,
dis_send: true,
dis_confirm: true,
fullscreenLoading: false,
form: {
tableMater: [],
dtl_row: null,
checked: '1'
},
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible2 = newValue
}
}
},
methods: {
close() {
this.$emit('update:dialogShow', false)
this.form.tableMater = []
this.form.checked = '1'
this.form.dtl_row = null
this.$emit('AddChanged')
},
clcikRow(row) {
this.form.dtl_row = row
},
delTask() {
this.fullscreenLoading = true
crudProductIn.delTask({ 'iostorinvdis_id': this.dis_row.iostorinvdis_id }).then(res => {
this.crud.notify('删除成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
sendTask() {
console.log(this.form.dtl_row)
// this.fullscreenLoading = true
// crudProductIn.sendTask({ 'task_id': this.dis_row.task_id }).then(res => {
// this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.fullscreenLoading = false
// this.queryTableDdis()
// this.initFlag()
// }).catch(() => {
// this.fullscreenLoading = false
// })
},
confirmTask() {
this.fullscreenLoading = true
crudProductIn.confirmTask({ 'task_id': this.dis_row.task_id }).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
queryTableDdis() {
if (this.form.dtl_row !== null) {
crudProductIn.getIosInvDis({ 'iostorinvdtl_id': this.form.dtl_row.iostorinvdtl_id }).then(res => {
this.form.tableMater = res
}).catch(() => {
this.form.tableMater = []
})
}
},
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
},
formatType(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.task_type]
},
initFlag() {
this.dis_del = true
this.dis_send = true
this.dis_confirm = true
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,362 @@
<!--suppress ALL -->
<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-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 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_MOVE_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="taskOpen"
>
任务作业
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
强制完成
</el-button>
<!--<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
:disabled="downdtl_flag"
size="mini"
@click="downdtl"
>
导出Excel
</el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
:max-height="590"
v-loading="crud.loading"
:data="crud.data"
size="mini"
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','check:del','check: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" width="55"/>
<el-table-column prop="bill_code" min-width="130" label="单据号">
<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" min-width="100" prop="bill_status" label="单据状态"/>
<el-table-column prop="stor_name" label="仓库" min-width="100"/>
<el-table-column prop="bill_type" :formatter="bill_typeFormat" min-width="100" label="业务类型"/>
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" min-width="100"/>
<el-table-column label="明细数" align="center" prop="dtl_count" min-width="100"/>
<el-table-column prop="biz_date" min-width="135" label="业务日期"/>
<el-table-column prop="create_time" min-width="135" label="创建日期"/>
</el-table>
<!--分页组件-->
<pagination/>
</div>
<AddDialog @AddChanged="querytable"/>
<MoveTaskDialog :dialog-show.sync="taskShow" :open-param="taskOpenParam" />
</div>
</template>
<script>
import check from '@/views/wms/storage_manage/product/moveInv/moveInv'
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/storage_manage/product/moveInv/AddDialog'
import MoveTaskDialog from '@/views/wms/storage_manage/product/moveInv/MoveTaskDialog'
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
import {download} from '@/api/data'
import {downloadFile} from '@/utils'
export default {
name: 'moveInv',
components: {AddDialog, MoveTaskDialog, crudOperation, rrOperation, udOperation, pagination},
cruds() {
return CRUD({
title: '用户',
props: {
// 每页数据条数f
size: 20
},
idField: 'moveinv_id', url: 'api/stIvtMoveinvCp', crudMethod: {...check},
optShow: {
add: true,
edit: false,
del: false,
reset: true,
download: false
}
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['MOVE_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_MOVE_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'check:add'],
edit: ['admin', 'check:edit'],
del: ['admin', 'check:del']
},
check_flag: true,
downdtl_flag: true,
confirm_flag: true,
currentRow: null,
storlist: [],
taskOpenParam:[],
taskShow: false
}
},
mounted: function () {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudStorattr.getStor({'stor_type': '4'}).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)
},
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
this.downdtl_flag = false
if (current.status === '10' || current.status === '30') {
this.check_flag = false
} else {
this.check_flag = true
}
if (current.status === '30' && current.is_nok) {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
}
},
stateFormat(row) {
return this.dict.label.MOVE_BILL_STATUS[row.bill_status]
},
bill_typeFormat(row) {
return this.dict.label.ST_INV_MOVE_TYPE[row.bill_type]
},
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
is_nokFormat(row) {
if (row.is_nok) {
return '异常'
} else {
return '正常'
}
},
handleCurrentChange(current) {
if (current === null) {
this.confirm_flag = true
this.check_flag = true
this.downdtl_flag = true
this.currentRow = null
}
},
checkboxT(row) {
return row.bill_status !== '99'
},
taskOpen() {
check.getMoveDtl({ 'moveinv_id': this.currentRow.moveinv_id }).then(res => {
this.taskOpenParam = res.content
})
this.taskShow = true
},
confirm() {
if (this.currentRow !== null) {
this.$refs.child2.setForm(this.currentRow)
}
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
download('/api/check/download', {check_id: this.currentRow.check_id}).then(result => {
downloadFile(result, this.currentRow.check_code + '盘点数据', 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
}
},
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>

View File

@@ -0,0 +1,49 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/stIvtMoveinvCp',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/stIvtMoveinvCp/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/stIvtMoveinvCp/update',
method: 'post',
data
})
}
export function getMoveDtl(data) {
return request({
url: '/api/stIvtMoveinvCp/getMoveDtl',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/stIvtCheckmstCp/getStructIvt',
method: 'get',
params
})
}
export default {
add,
edit,
del,
getMoveDtl,
getStructIvt
}

View File

@@ -62,7 +62,7 @@
class="filter-item"
>
<el-option
v-for="item in dict.ST_INV_RAW_IN_TYPE"
v-for="item in dict.ST_INV_CP_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -281,7 +281,7 @@ export default {
name: 'AddDialog',
components: { MaterDtl, BillDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
props: {
dialogShow: {
type: Boolean,

View File

@@ -137,7 +137,7 @@
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="130px" />
<el-table-column show-overflow-tooltip prop="canuse_qty" :formatter="crud.formatNum3" label="数量" width="80px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" width="70px" sortable />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" width="90px" sortable />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="85px" />
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重" width="85px" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" fixed="right">