add: 生产订单

This commit is contained in:
2023-05-25 14:58:35 +08:00
parent b8da36f71b
commit f530e6d7b4
19 changed files with 918 additions and 905 deletions

View File

@@ -186,7 +186,7 @@
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="单据类型" :formatter="bill_typeFormat" />
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" min-width="120"/>
<el-table-column prop="" label="生产车间" width="130" show-overflow-tooltip />
<!-- <el-table-column prop="" label="生产车间" width="130" show-overflow-tooltip />-->
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column label="总重量" align="center" prop="total_qty">
<template slot-scope="scope">

View File

@@ -1,11 +1,11 @@
<!--suppress ALL -->
<template>
<el-dialog
title="出库单编辑"
:title="crud.status.title"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
width="1200px"
@open="open"
@close="close"
>
@@ -26,39 +26,39 @@
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="生产车间" prop="product_code">
<label slot="label">生产车间:</label>
<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="bill_type">
<el-select
v-model="form.product_code"
v-model="form.bill_type"
clearable
placeholder="生产车间"
size="mini"
placeholder="业务类型"
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
@change="storChange"
>
<el-option
v-for="item in dict.product_area"
v-for="item in dict.ST_INV_OUT_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓库</label>
<el-select
v-model="form.bill_type"
v-model="form.stor_id"
clearable
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in dict.bill_type"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
@@ -94,19 +94,15 @@
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">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</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 = 'left' or 'right'-->
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
@@ -115,11 +111,11 @@
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
@click="insertEvent()"
>
添加物料
添加发货物料
</el-button>
<!-- <el-button
<el-button
slot="left"
class="filter-item"
type="primary"
@@ -128,7 +124,7 @@
@click="insertdtl()"
>
新增一行
</el-button>-->
</el-button>
</span>
</div>
@@ -140,97 +136,117 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center">
<!-- <template scope="scope">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
</el-input>
<span v-show="scope.row.edit">{{ scope.row.material_code }}</span>
</template>-->
</el-table-column>
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" align="center" min-width="150px" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" width="150px" align="center">
<!-- <template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.pcsn" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
</template>-->
</el-table-column>
<el-table-column prop="plan_qty" label="出库重量" width="150" align="center">
<template scope="scope">
<el-input-number v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" />
<!-- <span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>-->
</template>
</el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<!-- <el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
<template scope="scope">
<el-input v-model="scope.row.remark" size="mini" />
<span>{{ scope.row.remark }}</span>
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量">
<template slot-scope="scope">
<el-input-number
v-show="!scope.row.edit"
v-model="form.tableData[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
@change="changeQty"
/>
<span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>
</template>
</el-table-column>-->
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
</el-table-column>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
<template slot-scope="scope">
<el-input v-model="form.tableData[scope.$index].remark" size="small" />
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" 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
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" :stor-id="storId" @tableChanged="tableChanged5" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
<MaterDtl
:dialog-show.sync="materShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="tableChanged1"
/>
<AddDtl
:dialog-show.sync="dtlShow"
@tableChanged="tableChanged2"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/storage_manage/product/productOut/AddDtl'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import productOut from '@/views/wms/storage_manage/product/productOut/productout'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import AddDtl from '@/views/wms/storage_manage/product/productOut/AddDtl'
import crudStorattr, {getStor} from '@/views/wms/storage_manage/basedata/basedata'
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
product_code: '',
bill_status: '10',
total_qty: '0',
detail_count: '0',
bill_type: '',
remark: '',
workshop_id: '',
stor_id: '',
biz_date: new Date(),
out_stor_id: '',
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { AddDtl, MaterDialog },
components: { MaterDtl, AddDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_OUT_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
dicts: ['IO_BILL_STATUS', 'bill_type', 'product_area'],
data() {
return {
dialogVisible: false,
dtlShow: false,
materType: '',
materShow: false,
flagnow: false,
nowrow: {},
nowindex: '',
dtlShow: false,
opendtlParam: null,
materType: '03', // 关键成品
storlist: [],
inStorList: [],
invtypelist: [],
storId: null,
billtypelist: [],
rules: {
product_code: [
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
@@ -243,128 +259,126 @@ export default {
},
watch: {
dialogShow: {
handler(newValue) {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudProductIn.queryStor().then(res => {
this.storlist = res
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.beforeSubmit]() {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
},
[CRUD.HOOK.afterToEdit]() {
productOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_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 = false
this.form.tableData.splice(i, 1, row)
}*/
})
},
[CRUD.HOOK.afterToView]() {
productOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
// 获取入库单明细
crudProductIn.getIosInvDtl({ 'bill_code': this.form.bill_code }).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)
}
})
},
invtypeFormat(row, column) {
return this.dict.label.bill_type[row.source_bill_type]
},
storChange(row) {
this.storlist.forEach((item) => {
if (item.product_code === row) {
this.form.product_code = item.product_code
[CRUD.HOOK.afterToView]() {
crudProductIn.getIosInvDtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
async queryMater(index, row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
[CRUD.HOOK.beforeSubmit]() {
// 提交前校验
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
this.materShow = true
this.nowindex = index
this.nowrow = row
},
queryDtl(index, row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.form.product_code === '') {
this.crud.notify('请选择生产车间!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.storId = this.form.product_code
this.dtlShow = true
},
tableChanged5(rows) {
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].material_id === item.material_id && this.form.tableData[i].pcsn === item.pcsn) {
this.flagnow = true
}
}
if (!this.flagnow) {
item.edit = true
this.form.tableData.splice(-1, 0, item)
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
}
} else {
item.edit = true
this.form.tableData.splice(-1, 0, item)
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
}
})
this.form.detail_count = this.form.tableData.length
},
setMaterValue(row) {
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === row.material_id) {
this.crud.notify('不允许添加相同物料!')
const row = this.form.tableData[i]
if (!row.plan_qty) {
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
},
deleteRow(index, rows) {
const material_code = rows[index].material_code
let len = rows.length
while (len--) {
const obj = rows[len]
if (material_code === obj.material_code) {
const index = rows.indexOf(obj)
if (index > -1) { // 移除找到的指定元素
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
rows.splice(index, 1)
this.form.detail_count = this.form.tableData.length
}
}
}
},
tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = '0'
item.edit = true
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
tableChanged1(row) {
this.nowrow.material_id = row.material_id
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.nowrow.qty_unit_id = row.base_unit_id
this.nowrow.plan_qty = '0'
this.nowrow.qty_unit_name = row.unit_name
this.nowrow.plan_qty = '1'
this.nowrow.edit = false
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
this.nowrow.qty_unit_id = row.base_unit_id
},
async insertdtl() {
tableChanged2(row) {
},
insertEvent(row) {
this.dtlShow = true
},
queryMater(index, row) {
this.nowindex = index
this.nowrow = row
this.materShow = true
},
insertdtl() {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.form.tableData.push({ material_id: '', material_code: '', material_name: '', pcsn: '', quality_scode: '00', plan_qty: '1', qty_unit_name: '', qty_unit_id: '', remark: '', edit: false })
this.form.tableData.push({ edit: false, plan_qty: '0' })
this.form.detail_count = this.form.tableData.length
},
deleteRow(index, rows) {
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
rows.splice(index, 1)
changeQty() {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
})
}
}
}
@@ -372,16 +386,13 @@ export default {
<style>
.crud-opts2 {
padding: 0 0;
padding: 4px 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

@@ -1,4 +1,3 @@
<!--suppress ALL -->
<template>
<el-dialog
append-to-body
@@ -24,7 +23,7 @@
<span class="role-span">出库明细</span>
<div class="crud-opts-form">
<el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="生产车间" prop="gender2">
<el-form-item label="库区" prop="gender2">
<el-cascader
placeholder="请选择"
:options="sects"
@@ -93,17 +92,6 @@
>
手工分配
</el-button>-->
<el-button
slot="left"
class="filter-item"
type="warning"
:loading="loadingSetAllPoint"
icon="el-icon-check"
size="mini"
@click="allSetPointAllDtl"
>
一键设置
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
@@ -127,6 +115,9 @@
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="assign_qty" label="已分配重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="unassign_qty" label="未分配重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" align="center" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
@@ -151,7 +142,7 @@
disabled
/>
</el-form-item>
<!-- <el-form-item label="出库点" prop="point_code">
<el-form-item label="出库点" prop="point_code">
<el-select
v-model="form2.point_code"
clearable
@@ -166,24 +157,12 @@
:value="item.point_code"
/>
</el-select>
</el-form-item>-->
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
:loading="loadingSetPoint"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="button4"
@click="oneSetPoint2"
>
设置站点
</el-button>-->
<el-button
slot="left"
class="filter-item"
@@ -211,7 +190,7 @@
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
<!-- <el-table-column prop="bill_status" label="状态" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.work_status"
@@ -226,7 +205,7 @@
/>
</el-select>
</template>
</el-table-column>
</el-table-column>-->
<el-table-column prop="material_code" label="物料编码" width="150px" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" width="250px" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="material_spec" label="物料规格" width="150px" :min-width="flexWidth('material_spec',crud.data,'物料规格')" />
@@ -246,8 +225,8 @@
import CRUD, { crud } from '@crud/crud'
import productOut from '@/views/wms/storage_manage/product/productOut/productout'
import StructIvt from '@/views/wms/storage_manage/product/productOut/StructIvt'
import crudRegion from '@/views/wms/scheduler_manage/region/region'
import crudPoint from '@/views/wms/scheduler_manage/point/point'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'DivDialog',
@@ -328,13 +307,12 @@ export default {
},
methods: {
open() {
crudRegion.getRegionSelect({ 'stor_id': this.storId }).then(res => {
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
const area_type = 'A1_CK01'
const area_type = 'A1_RK01'
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
this.pointList = res
this.pointlist = res
})
},
close() {
@@ -356,26 +334,6 @@ export default {
}
}
},
openPoint() {
if (this.mstrow.bill_type === '010101') {
this.areatype = "'31'"
} else if (this.mstrow.bill_type === '010201' || this.mstrow.bill_type === '010202' || this.mstrow.bill_type === '010401') {
this.areatype = "'21'"
} else if (this.mstrow.bill_type === '010503' || this.mstrow.bill_type === '010501') {
this.areatype = "'22','23','24'"
} else if (this.mstrow.bill_type === '010502') {
this.areatype = "'21','22','23','24'"
} else if (this.mstrow.bill_type === '010801') {
this.areatype = "'22','23','24','31','35'"
} else if (this.mstrow.bill_type === '010601') {
this.areatype = ''
}
this.pointshow = true
this.$refs.child.getMsg(this.areatype)
},
PointChanged(row) {
this.form2.point_code = row.point_code
},
openStructIvt() {
this.currentRow.remark = ''
this.currentRow.stor_id = this.storId
@@ -399,13 +357,6 @@ export default {
this.mstrow.sect_id = val[1]
}
},
tabledisabled(row) {
if ((row.work_status === '00' || row.work_status === '01') && row.is_issued === '0') {
return false
} else {
return true
}
},
deleteRow(row) {
productOut.oneCancel(row).then(res => {
this.queryTableDtl()
@@ -492,42 +443,6 @@ export default {
})
}
},
allSetPoint() {
/* if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}*/
if (this.currentRow === '') {
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.loadingSetAllPoint = true
this.currentRow.point_code = this.form2.point_code
productOut.allSetPoint(this.currentRow).then(res => {
this.queryTableDdis(this.currentRow.iostorinvdtl_id)
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
this.loadingSetAllPoint = false
}).catch(() => {
this.loadingSetAllPoint = false
})
},
allSetPointAllDtl() {
/* if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}*/
this.loadingSetAllPoint = true
const data = {
'point_code': this.form2.point_code,
'iostorinv_id': this.mstrow.iostorinv_id
}
productOut.allSetPoint(data).then(res => {
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
this.loadingSetAllPoint = false
}).catch(() => {
this.loadingSetAllPoint = false
})
},
queryTableDtl() {
productOut.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
this.tableDtl = res

View File

@@ -1,4 +1,3 @@
<!--suppress ALL -->
<template>
<div class="app-container">
<!--工具栏-->
@@ -128,6 +127,32 @@
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="单据类型" :formatter="bill_typeFormat" />
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" min-width="120"/>
<!-- <el-table-column prop="" label="生产车间" width="130" show-overflow-tooltip />-->
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
<el-table-column label="总重量" align="center" prop="total_qty">
<template slot-scope="scope">
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<el-table-column label="明细数" align="center" prop="detail_count" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建人" align="center" prop="create_name" />
<el-table-column label="创建时间" align="center" prop="create_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_name" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="分配人" align="center" prop="dis_name" width="140px" />
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_name" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
@@ -138,27 +163,6 @@
/>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="80" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="product_code" label="生产车间" width="80" />
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
<el-table-column show-overflow-tooltip label="总重量" align="center" prop="total_qty" width="100" />
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="create_name" />
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="create_time" width="140" />
<el-table-column show-overflow-tooltip label="修改人" align="center" prop="create_name" />
<el-table-column show-overflow-tooltip label="修改时间" align="center" prop="update_time" width="140" />
<el-table-column show-overflow-tooltip label="分配人" align="center" prop="dis_name" />
<el-table-column show-overflow-tooltip label="分配时间" align="center" prop="dis_time" width="140" />
<el-table-column show-overflow-tooltip label="确认人" align="center" prop="confirm_name" />
<el-table-column show-overflow-tooltip label="确认时间" align="center" prop="confirm_time" width="140" />
</el-table>
<!--分页组件-->
<pagination />
@@ -179,7 +183,7 @@ import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/storage_manage/product/productOut/AddDialog'
import DivDialog from '@/views/wms/storage_manage/product/productOut/DivDialog'
import ViewDialog from '@//views/wms/storage_manage/product/productOut/ViewDialog'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
export default {
name: 'ProductOut',
@@ -230,11 +234,14 @@ export default {
}
},
created() {
crudProductIn.queryStor().then(res => {
this.storlist = res
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
this.storlist = res.content
})
},
methods: {
fun(val) {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status !== '10'
},
@@ -293,9 +300,9 @@ export default {
return row.bill_status !== '99'
},
divOpen() {
productOut.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
productOut.getIosInvDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.storId = this.currentRow.product_code
this.storId = this.currentRow.stor_id
this.divShow = true
this.mstrow = this.currentRow
})

View File

@@ -10,219 +10,26 @@ export function add(data) {
export function del(ids) {
return request({
url: 'api/productOut/',
method: 'delete',
url: 'api/productOut/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/productOut',
method: 'put',
url: 'api/productOut/update',
method: 'post',
data
})
}
export function getOutBillDtl(data) {
export function getIosInvDtl(data) {
return request({
url: '/api/productOut/getOutBillDtl',
url: 'api/productOut/getIosInvDtl',
method: 'post',
data
})
}
export function getOutBillDis(data) {
return request({
url: '/api/productOut/getOutBillDis',
method: 'post',
data
})
}
export function getOutBillDisDtl(params) {
return request({
url: '/api/productOut/getOutBillDisDtl',
method: 'get',
params
})
}
export function getOutBillTask(params) {
return request({
url: '/api/productOut/getOutBillTask',
method: 'get',
params
})
}
export function getInvTypes() {
return request({
url: '/api/productOut/getInvTypes',
method: 'get'
})
}
export function insertDtl(data) {
return request({
url: '/api/productOut/insertDtl',
method: 'post',
data
})
}
export function allDiv(data) {
return request({
url: '/api/productOut/allDiv',
method: 'post',
data
})
}
export function allDivOne(data) {
return request({
url: '/api/productOut/allDivOne',
method: 'post',
data
})
}
export function allCancel(data) {
return request({
url: '/api/productOut/allCancel',
method: 'post',
data
})
}
export function oneCancel(data) {
return request({
url: '/api/productOut/oneCancel',
method: 'post',
data
})
}
export function setPoint(data) {
return request({
url: '/api/productOut/setPoint',
method: 'post',
data
})
}
export function oneSetPoint(data) {
return request({
url: '/api/productOut/oneSetPoint',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/productOut/getStructIvt',
method: 'get',
params
})
}
export function manualDiv(data) {
return request({
url: '/api/productOut/manualDiv',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/productOut/confirm',
method: 'post',
data
})
}
export function issueTask(data) {
return request({
url: '/api/productOut/issueTask',
method: 'post',
data
})
}
export function finishTask(data) {
return request({
url: '/api/productOut/finishTask',
method: 'post',
data
})
}
export function cancleTaskfinish(data) {
return request({
url: '/api/productOut/cancleTaskfinish',
method: 'post',
data
})
}
export function paramByCodeType(data) {
return request({
url: '/api/productOut/paramByCodeType',
method: 'post',
data
})
}
export function schAreaType(data) {
return request({
url: '/api/productOut/schAreaType',
method: 'post',
data
})
}
export function backConfirm(data) {
return request({
url: '/api/productOut/backConfirm',
method: 'post',
data
})
}
export function getType() {
return request({
url: '/api/productOut/getType',
method: 'get'
})
}
export function moneySubmit(data) {
return request({
url: '/api/productOut/moneySubmit',
method: 'post',
data
})
}
export function getDisNum(data) {
return request({
url: '/api/productOut/getDisNum',
method: 'post',
data
})
}
export function queryBox(data) {
return request({
url: '/api/productOut/queryBox',
method: 'post',
data
})
}
export function getOutBillTask2(data) {
return request({
url: '/api/productOut/getOutBillTask2',
method: 'post',
data
})
}
export function cancelTask(data) {
return request({
url: '/api/productOut/cancelTask',
method: 'post',
data
})
}
export function allSetPoint(data) {
return request({
url: '/api/productOut/allSetPoint',
method: 'post',
data
})
}
export function oneSetPoint2(data) {
return request({
url: '/api/productOut/oneSetPoint2',
method: 'post',
data
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 }
export default { add, edit, del, getIosInvDtl }

View File

@@ -1,410 +0,0 @@
<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"
width="1200px"
@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-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="product_code">
<label slot="label">所属仓库2:</label>
<el-select
v-model="form.stor_id"
clearable
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
>
<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="point_code">
<label slot="label">入库点:</label>
<el-select
v-model="form.point_code"
clearable
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
>
<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"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in dict.bill_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"
clearable
style="width: 210px"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.IO_BILL_STATUS"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</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">总&nbsp;&nbsp;重&nbsp;量:</label>
<el-input-number
v-model="form.total_qty"
:controls="false"
: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">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
</el-form-item>
</el-form>
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
<div v-show="crud.status.add === 1" class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertEvent()"
>
添加物料
</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 type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip prop="base_bill_code" label="订单号">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].base_bill_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="plan_qty" label="数量">
<template slot-scope="scope">
<el-input-number
v-model="form.tableData[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
@change="changeQty"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重">
<template slot-scope="scope">
<el-input-number
v-model="form.tableData[scope.$index].unit_weight"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号">
<template slot-scope="scope">
<el-input
v-model="form.tableData[scope.$index].storagevehicle_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
</template>
</el-table-column>
<el-table-column v-if="crud.status.add === 1" align="center" label="操作" width="170" 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>
<MaterDtl
:dialog-show.sync="materShow"
:is-single="false"
:mater-opt-code="materType"
@setMaterValue="tableChanged"
/>
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import crudsemiproductIn from '@/views/wms/storage_manage/semiproduct/semiproductIn/semiproductIn'
import MaterDtl from '@/views/wms/pub/MaterDialog'
const defaultForm = {
bill_code: '',
product_code: 'A1',
bill_status: '1',
total_qty: '0',
detail_count: '0',
bill_type: '',
remark: '',
biz_date: new Date(),
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { MaterDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
cruds() {
return CRUD({ title: '入库新增', crudMethod: { ...crudsemiproductIn }})
},
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
materShow: false,
dtlShow: false,
opendtlParam: null,
materType: '03', // 关键成品
storlist: [],
billtypelist: [],
rules: {
product_code: [
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudsemiproductIn.queryStor().then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudsemiproductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
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.afterToView]() {
crudsemiproductIn.getIODtl({ 'bill_code': this.form.bill_code }).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.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++) {
const row = this.form.tableData[i]
if (!row.base_bill_code) {
this.crud.notify('订单号', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.plan_qty) {
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.form.stor_id) {
this.crud.notify('所属仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!this.form.point_code) {
this.crud.notify('入库点不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.storagevehicle_code) {
this.crud.notify('载具不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.unit_weight) {
this.crud.notify('单重不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
},
deleteRow(index, rows) {
const material_code = rows[index].material_code
let len = rows.length
while (len--) {
const obj = rows[len]
if (material_code === obj.material_code) {
const index = rows.indexOf(obj)
if (index > -1) { // 移除找到的指定元素
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
rows.splice(index, 1)
this.form.detail_count = this.form.tableData.length
}
}
}
},
tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = '1'
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
insertEvent(row) {
this.materShow = true
},
changeQty() {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 4px 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>