fix:原材料入库

This commit is contained in:
2023-05-17 09:54:26 +08:00
parent 535b1a6b8c
commit 8026de6ec2
43 changed files with 2345 additions and 1301 deletions

View File

@@ -379,7 +379,7 @@ export default {
}
},
created() {
crudSectattr.getSect().then(res => {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
/* checkoutbill.getInvTypes().then(res => {

View File

@@ -139,6 +139,16 @@
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left"/>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertBill()"
>
添加单据物料
</el-button>
<el-button
slot="left"
class="filter-item"
@@ -191,7 +201,6 @@
</el-table-column>
<el-table-column show-overflow-tooltip prop="source_bill_type_name" label="源单类型"/>
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号"/>
<el-table-column show-overflow-tooltip prop="supp_name" label="供应商"/>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
<template scope="scope">
<el-button
@@ -212,12 +221,19 @@
@setMaterValue="tableChanged"
/>
<BillDtl
:dialog-show.sync="billShow"
:is-single="false"
@setMaterValue="tableChanged2"
/>
</el-dialog>
</template>
<script>
import CRUD, {crud, form} from '@crud/crud'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import BillDtl from '@/views/wms/storage_manage/rawproduct/rawProductIn/AddDtl'
import crudStorattr from "@/api/wms/basedata/st/storattr";
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import crudStructattr from "@/api/wms/basedata/st/structattr";
@@ -239,7 +255,7 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: {MaterDtl},
components: {MaterDtl, BillDtl},
mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
props: {
@@ -255,6 +271,7 @@ export default {
return {
dialogVisible: false,
materShow: false,
billShow: false,
dtlShow: false,
struct_id: '',
sect_id: '',
@@ -422,9 +439,36 @@ export default {
})
this.form.detail_count = this.form.tableData.length
},
tableChanged2(rows) {
debugger
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
debugger
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code && row.po_code === item.po.code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = item.need_qty
item.source_bill_code = item.po_code
item.source_bill_type_name = '原料需求'
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
},
insertBill(row) {
this.billShow = true
},
changeQty() {
this.form.total_qty = 0
this.form.tableData.forEach((item) => {

View File

@@ -1,67 +1,55 @@
<!--suppress ALL -->
<template>
<el-dialog
title="物料新增"
title="原料需求"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
width="1200px"
@close="close"
@open="open"
>
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd" />
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="单据号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.package_box_sn"
clearable
size="mini"
placeholder="箱号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.container_name"
clearable
size="mini"
placeholder="子卷号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料编码"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.sap_pcsn"
clearable
size="mini"
placeholder="sap批次"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="日期">
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
</el-form-item>
<el-form-item label="单据号">
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="单据号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation />
<crudOperation/>
<!--表格渲染-->
<el-table
ref="multipleTable"
@@ -70,21 +58,18 @@
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip width="150" prop="sale_order_name" label="订单号" />
<el-table-column show-overflow-tooltip width="150" prop="customer_name" label="客户编号" />
<el-table-column width="200" prop="customer_description" label="客户名称" />
<el-table-column show-overflow-tooltip prop="package_box_sn" width="250" label="箱号" />
<el-table-column show-overflow-tooltip width="100" prop="quanlity_in_box" label="箱内子卷数" />
<el-table-column show-overflow-tooltip width="150" prop="container_name" label="子卷号" />
<el-table-column show-overflow-tooltip width="150" prop="sap_pcsn" label="sap批次" />
<el-table-column show-overflow-tooltip width="150" prop="product_name" label="物料编码" />
<el-table-column show-overflow-tooltip width="170" prop="product_description" label="物料描述" />
<el-table-column show-overflow-tooltip prop="width" label="幅宽" />
<el-table-column show-overflow-tooltip prop="thickness" label="产品厚度" />
<el-table-column type="selection" width="55"/>
<el-table-column show-overflow-tooltip width="150" prop="ask_time" label="日期"/>
<el-table-column show-overflow-tooltip width="150" prop="po_code" label="单据号"/>
<el-table-column show-overflow-tooltip prop="material_code" width="250" label="物料编号"/>
<el-table-column show-overflow-tooltip width="100" prop="material_name" label="物料名称"/>
<el-table-column show-overflow-tooltip width="150" prop="class_name" label="物料类别"/>
<el-table-column show-overflow-tooltip width="150" prop="total_qty" label="重量"/>
<el-table-column show-overflow-tooltip width="170" prop="need_qty" label="待入重量"/>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位"/>
</el-table>
<!--分页组件-->
<pagination />
<pagination/>
</div>
<span slot="footer" class="dialog-footer">
@@ -96,7 +81,7 @@
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import CRUD, {crud, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
@@ -106,11 +91,11 @@ import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/ra
const start = new Date()
export default {
name: 'AddDtl',
components: { crudOperation, rrOperation, pagination, DateRangePicker },
components: {crudOperation, rrOperation, pagination, DateRangePicker},
cruds() {
return CRUD({
title: '用户',
url: '/api/in/rawAssist/getBillDtl',
title: '采购订单',
url: '/api/pcsIfPurchaseorder/forRawIn',
crudMethod: {},
optShow: {
reset: true
@@ -122,9 +107,6 @@ export default {
dialogShow: {
type: Boolean,
default: false
},
opendtlParam: {
type: Object
}
},
data() {
@@ -142,25 +124,6 @@ export default {
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.bill_type = '0001'
return true
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
},
open() {
this.crud.toQuery()
},
@@ -168,14 +131,10 @@ export default {
this.$emit('update:dialogShow', false)
},
submit() {
debugger
this.$emit('update:dialogShow', false)
this.rows = this.$refs.multipleTable.selection
crudProductIn.queryBoxMater(this.rows).then(res => {
this.rows = res
this.$emit('tableChanged', this.rows)
})
// this.form = this.$options.data().form
this.$emit('setMaterValue', this.rows)
}
}
}

View File

@@ -291,12 +291,7 @@ export default {
buttonChange(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10' || currentRow.bill_status === '20' || currentRow.bill_status === '30') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (currentRow.bill_status === '30') {
if (currentRow.bill_status === '10') {
this.confirm_flag = false
} else {
this.confirm_flag = true

View File

@@ -1,61 +1,83 @@
<!--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"
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
<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-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 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-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
class="filter-item"
@change="storChange"
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="workshop_id">
<label slot="label">车间</label>
<el-select
v-model="form.workshop_id"
clearable
filterable
size="mini"
placeholder="业务类型"
placeholder="全部"
class="filter-item"
>
<el-option
v-for="item in dict.bill_type"
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -81,7 +103,7 @@
</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-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>
@@ -94,41 +116,38 @@
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-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" />
<slot name="left"/>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
@click="insertBill()"
>
添加物料
添加单据物料
</el-button>
<!-- <el-button
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertdtl()"
@click="insertEvent()"
>
新增一行
</el-button>-->
选择库存
</el-button>
</span>
</div>
@@ -140,231 +159,280 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center">
<!-- <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-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>-->
<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="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 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="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"
:controls="false"
controls-position="right"
@change="changeQty"
/>
</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="source_bill_type_name" 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" />
<StructIvt
:dialog-show.sync="materShow"
:is-single="false"
@setMaterValue="tableChanged"
/>
<BillDtl
:dialog-show.sync="billShow"
:is-single="false"
:mater-opt-code="materType"
@setMaterValue="tableChanged"
/>
</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/rawproduct/rawProductOut/rawproductout'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import CRUD, {crud, form} from '@crud/crud'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import BillDtl from '@/views/wms/storage_manage/rawproduct/rawProductIn/AddDtl'
import crudStorattr from "@/api/wms/basedata/st/storattr";
import crudProductOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
import crudStructattr from "@/api/wms/basedata/st/structattr";
import StructIvt from "@/views/wms/storage_manage/rawproduct/rawProductOut/StructIvt";
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
product_code: '',
bill_status: '10',
total_qty: '0',
detail_count: '0',
stor_id: '',
struct_id: '',
bill_type: '',
remark: '',
biz_date: new Date(),
out_stor_id: '',
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { AddDtl, MaterDialog },
components: {StructIvt, MaterDtl, BillDtl},
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: '',
billShow: false,
dtlShow: false,
struct_id: '',
sect_id: '',
opendtlParam: null,
materType: '03', // 关键成品
storlist: [],
inStorList: [],
invtypelist: [],
storId: null,
sects: [],
billtypelist: [],
rules: {
product_code: [
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
{required: true, message: '生产车间不能为空', trigger: 'blur'}
],
bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
{required: true, message: '业务类型不能为空', trigger: 'blur'}
],
biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
{required: true, message: '业务日期不能为空', trigger: 'blur'}
]
}
}
},
watch: {
dialogShow: {
handler(newValue) {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudProductIn.queryStor().then(res => {
this.storlist = res
crudStorattr.queryStor({"stor_type": "3"}).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.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]
row.edit = true
this.form.tableData.splice(i, 1, row)
}
})
},
invtypeFormat(row, column) {
return this.dict.label.bill_type[row.source_bill_type]
[CRUD.HOOK.beforeToEdit]() {
this.struct_id = this.crud.form.struct_id
this.sect_id = this.crud.form.sect_id
crudStructattr.getSectCascader({'stor_id': this.crud.form.stor_id}).then(res => {
this.sects = res.content
this.form.struct_id = this.search(this.sects, this.struct_id)
})
},
storChange(row) {
this.storlist.forEach((item) => {
if (item.product_code === row) {
this.form.product_code = item.product_code
[CRUD.HOOK.afterToView]() {
crudProductIn.getIODtl({'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.stor_id) {
this.crud.notify('仓库不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
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
}
}
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.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 替换数据 触发视图更新
},
async insertdtl() {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.sect_id = this.sect_id
row.struct_id = this.struct_id
}
},
storChange(value) {
crudStructattr.getSectCascader({'stor_id': value}).then(res => {
this.sects = res.content
})
},
search(object, value) {
debugger
for (var key in object) {
if (object[key].value == value) return [object[key].value];
if (object[key].children && Object.keys(object[key].children).length > 0) {
var temp = search(object[key].children, value);
if (temp) return [object[key].value, temp].flat();
}
}
},
sectQueryChange(val) {
debugger
this.sectProp = val
if (val.length === 1) {
this.sect_id = val[0]
this.struct_id = ''
}
if (val.length === 0) {
this.sect_id = ''
this.struct_id = ''
}
if (val.length === 2) {
this.sect_id = val[0]
this.struct_id = val[1]
}
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.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)
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) => {
debugger
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_code === item.material_code && row.struct_id === item.struct_id) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = item.canuse_qty
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
},
insertBill(row) {
this.billShow = 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)
})
}
}
}
@@ -372,16 +440,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,119 +1,124 @@
<!--suppress ALL -->
<template>
<el-dialog
title="物料选择"
title="物料新增"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
width="1200px"
@close="close"
@open="open"
>
<div class="head-container">
<div>
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input
v-model="query.material_code"
clearable
size="mini"
placeholder="物料编码、名称"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.material_spec"
clearable
size="mini"
placeholder="物料规格"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.pcsn"
clearable
size="mini"
placeholder="订单号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="日期">
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
</el-form-item>
<el-form-item label="单据号">
<el-input
v-model="query.bill_code"
clearable
size="mini"
placeholder="单据号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation/>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column show-overflow-tooltip width="150" prop="sale_order_name" label="日期"/>
<el-table-column show-overflow-tooltip width="150" prop="customer_name" label="单据号"/>
<el-table-column width="200" prop="customer_description" label="供应商"/>
<el-table-column show-overflow-tooltip prop="package_box_sn" width="250" label="物料编号"/>
<el-table-column show-overflow-tooltip width="100" prop="quanlity_in_box" label="物料名称"/>
<el-table-column show-overflow-tooltip width="150" prop="container_name" label="物料类别"/>
<el-table-column show-overflow-tooltip width="150" prop="sap_pcsn" label="批次"/>
<el-table-column show-overflow-tooltip width="150" prop="product_name" label="重量"/>
<el-table-column show-overflow-tooltip width="170" prop="product_description" label="待入重量"/>
<el-table-column show-overflow-tooltip prop="width" label="重量单位"/>
</el-table>
<!--分页组件-->
<pagination/>
</div>
<!--表格渲染-->
<el-table
ref="multipleTable"
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 prop="instorage_time" label="入库日期" :min-width="flexWidth('instorage_time',crud.data,'入库日期')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_name',crud.data,'物料规格')" />
<el-table-column prop="struct_code" label="点位" :min-width="flexWidth('struct_name',crud.data,'点位')" />
<el-table-column prop="pcsn" label="订单号" :min-width="flexWidth('pcsn',crud.data,'订单号')" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="可用数" />
<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>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import CRUD, {crud, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
const start = new Date()
export default {
name: 'AddDtl',
components: { rrOperation, pagination },
components: {crudOperation, rrOperation, pagination, DateRangePicker},
cruds() {
return CRUD({
title: '用户', url: 'api/productOut/addDtl',
title: '用户',
url: '/api/in/rawAssist/getBillDtl',
crudMethod: {},
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
},
query: {
reset: true
}
})
},
mixins: [presenter(), header()],
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
},
storId: {
type: String
opendtlParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
opendtlParam: '',
rows: [],
openShow: true
tableData: []
}
},
watch: {
@@ -121,42 +126,43 @@ export default {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.mater_type = this.opendtlParam
this.crud.query.stor_id = this.storId
if (this.openShow) {
this.openShow = false
return false
} else {
return true
}
this.crud.query.bill_type = '0001'
return true
},
close() {
this.crud.resetQuery(false)
// 清空grid数据
this.crud.data = undefined
this.$emit('update:dialogShow', false)
objectSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
},
open() {
this.crud.query.mater_type = this.opendtlParam
this.crud.toQuery()
},
close() {
this.$emit('update:dialogShow', false)
},
submit() {
this.rows = this.$refs.multipleTable.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
this.rows = this.$refs.multipleTable.selection
crudProductIn.queryBoxMater(this.rows).then(res => {
this.rows = res
this.$emit('tableChanged', this.rows)
})
// this.form = this.$options.data().form
}
}
}

View File

@@ -12,7 +12,7 @@
<span slot="title" class="dialog-footer">
<div class="crud-opts2">
<span class="el-dialog__title2">库分配</span>
<span class="el-dialog__title2">库分配</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
@@ -21,10 +21,70 @@
</div>
</span>
<div class="crud-opts2">
<span class="role-span">库明细</span>
<span class="role-span">库明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="dtl_table"
:data="this.openParam"
style="width: 100%;"
max-height="300"
border
highlight-current-row
:row-class-name="tableRowClassName"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.bill_status"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in dict.IO_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
</el-table>
</el-card>
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item label="入库点" prop="point_code">
<el-select
v-model="form.point_code"
clearable
placeholder="请选择"
class="filter-item"
style="width: 200px;"
>
<el-option
v-for="item in pointlist"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code"
/>
</el-select>
</el-form-item>
</el-form>
</el-card>
<div class="crud-opts2">
<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="gender5">
<el-cascader
placeholder="请选择"
:options="sects"
@@ -33,6 +93,9 @@
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item prop="checked">
<el-checkbox v-model="form.checked">自动分配货位</el-checkbox>
</el-form-item>
</el-form>
</div>
<span class="crud-opts-right2">
@@ -41,13 +104,23 @@
<el-button
slot="left"
class="filter-item"
:loading="loadingAlldiv"
type="primary"
icon="el-icon-plus"
size="mini"
@click="allDiv()"
@click="confirmvehicle()"
>
全部分配
组盘确认
</el-button>
<el-button
slot="left"
:loading="divBtn"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="divStruct()"
>
分配货位
</el-button>
<el-button
slot="left"
@@ -55,171 +128,61 @@
type="primary"
icon="el-icon-plus"
size="mini"
@click="allCancel()"
@click="unDivStruct()"
>
全部取消
</el-button>
<el-button
slot="left"
class="filter-item"
:loading="loadingAutodiv"
type="primary"
icon="el-icon-check"
size="mini"
:disabled="button1"
@click="oneDiv()"
>
自动分配
取消分配
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-check"
icon="el-icon-delete"
size="mini"
:disabled="button2"
@click="oneCancel()"
@click="divPoint()"
>
自动取消
</el-button>
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
:disabled="button3"
@click="openStructIvt"
>
手工分配
</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'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
ref="dis_table"
:data="form.tableMater"
style="width: 100%;"
max-height="300"
border
:cell-style="cellStyle"
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
@row-click="clcikRowDis"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" />
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" width="140px" />
<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>
</el-card>
<div class="crud-opts2">
<span class="role-span">分配明细</span>
<div class="crud-opts-form">
<el-form ref="form2" :inline="true" :model="form2" size="mini">
<el-form-item label="待分配" prop="unassign_qty">
<el-input-number
v-model="form2.unassign_qty"
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" />
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center">
<template slot-scope="scope">
<el-input
v-model="form.tableMater[scope.$index].storagevehicle_code"
clearable
:controls="false"
:precision="3"
:min="0"
disabled
controls-position="right"
size="small"
/>
</el-form-item>
<el-form-item label="已分配" prop="assign_qty">
<el-input-number
v-model="form2.assign_qty"
:controls="false"
:precision="3"
:min="0"
disabled
/>
</el-form-item>
<!-- <el-form-item label="出库点" prop="point_code">
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="overstruct_type" label="载具超限" align="center">
<template slot-scope="scope">
<el-select
v-model="form2.point_code"
v-model="form.tableMater[scope.$index].overstruct_type"
clearable
placeholder="请选择"
class="filter-item"
style="width: 200px;"
style="width: 100px;"
>
<el-option
v-for="item in this.pointList"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code"
/>
</el-select>
</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"
:loading="loadingSetAllPoint"
type="warning"
icon="el-icon-check"
:disabled="button5"
size="mini"
@click="allSetPoint"
>
一键设置
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="tabledis"
style="width: 100%;"
max-height="400"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
<template slot-scope="scope">
<el-select
v-model="scope.row.work_status"
class="filter-item"
:disabled="true"
>
<el-option
v-for="item in dict.work_status"
v-for="item in dict.MD_OVERSTRUCT_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -227,44 +190,43 @@
</el-select>
</template>
</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,'物料规格')" />
<el-table-column prop="pcsn" label="订单号" width="150px" :min-width="flexWidth('pcsn',crud.data,'订单号')" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" width="150px" label="点位编码" align="center" />
<el-table-column show-overflow-tooltip prop="struct_name" width="150px" label="点位名称" align="center" />
<el-table-column show-overflow-tooltip prop="task_code" width="150px" label="任务号" align="center" />
<el-table-column show-overflow-tooltip prop="point_code" width="150px" label="出库点" align="center" />
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
</el-table>
</el-card>
<StructIvt :dialog-show.sync="structshow" :stor-id="storId" :open-array="openParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl" />
<StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" :sect-prop="sectProp" @tableChanged="tableChanged" />
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import productOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
import StructIvt from '@/views/wms/storage_manage/rawproduct/rawProductOut/StructIvt'
import crudRegion from '@/api/wms/sch/region'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import crudPoint from '@/api/wms/sch/point'
import crudRegion from '@/api/wms/sch/region'
export default {
name: 'DivDialog',
components: { StructIvt },
components: {},
mixins: [crud()],
dicts: ['IO_BILL_STATUS', 'work_status'],
dicts: ['IO_BILL_STATUS', 'MD_OVERSTRUCT_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
bussConfig: {
type: Object
},
openArray: {
openParam: {
type: Array,
default: () => { return [] }
default: () => {
return []
}
},
billType: {
type: String,
default: null
},
storId: {
type: String,
@@ -274,39 +236,29 @@ export default {
data() {
return {
dialogVisible: false,
loadingAlldiv: false,
loadingAutodiv: false,
loadingSetPoint: false,
loadingSetAllPoint: false,
areatype: '',
typedisable: false,
pointshow: false,
structshow: false,
button1: true,
button2: true,
button3: true,
button4: true,
button5: true,
tableDtl: [],
openParam: [],
mstrow: {},
openRow: {},
tabledis: [],
currentRow: {},
currentDis: {},
form: {
gender2: ''
},
form2: {
unassign_qty: '0',
assign_qty: '0',
point_code: ''
},
stor_id: '',
sect_id: '',
sectProp: null,
bucketProp: {},
structShow: false,
bucketObj: null,
divBtn: false,
bucketShow: false,
sects: [],
invtypelist: [],
pointList: [],
rules: {
}
sect_val: null,
dis_row: null,
form: {
dtl_row: null,
storage_qty: '',
sect_id: '',
stor_id: '',
point_code: null,
checked: true,
tableMater: []
},
storlist: [],
pointlist: [],
rules: {}
}
},
watch: {
@@ -314,16 +266,6 @@ export default {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openArray: {
handler(newValue, oldValue) {
this.tableDtl = newValue
}
},
rowmst: {
handler(newValue, oldValue) {
this.mstrow = newValue
}
}
},
methods: {
@@ -331,224 +273,226 @@ export default {
crudRegion.getRegionSelect({ '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
})
},
toDelete(data) {
data.pop = true
},
close() {
this.$refs['form2'].resetFields()
this.tabledis = []
this.$emit('DivChanged')
this.form.tableMater = []
this.form.dtl_row = null
this.sectProp = null
this.$emit('update:dialogShow', false)
this.$emit('AddChanged')
this.crud.refresh()
this.$refs['form2'].resetFields()
},
bill_statusFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
quality_scodeFormat(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
invtypeFormat(row, column) {
for (const item of this.invtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
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
productOut.getStructIvt(this.currentRow).then(res => {
clcikRow(row, column, event) {
this.form.dtl_row = row
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
this.openParam = res
this.structshow = true
this.openRow = this.currentRow
this.form.dtl_row = res[row.index]
})
crudProductIn.getDisDtl(row).then(res => {
this.form.tableMater = res
})
},
clcikRowDis(row, column, event) {
this.dis_row = row
},
vehicleCheck() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
this.form.storagevehicle_code = ''
return
}
crudProductIn.checkVehicle({
'storagevehicle_code': this.form.storagevehicle_code,
'dis_num': this.form.tableMater.length,
'iostorinv_id': this.form.dtl_row.iostorinv_id
}).then(res => {
}).catch(err => {
this.form.storagevehicle_code = ''
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
insertvehicle() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (!this.form.storagevehicle_code) {
this.crud.notify('请输入托盘号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 判断是否选择了桶号
if (this.bucketObj) {
if (!(this.bucketObj.status === '01')) {
this.crud.notify('请校验桶状态!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const dis_dtl = JSON.parse(JSON.stringify(this.bucketObj))
// 判断选择的桶是否已经被选过
const flag = this.form.tableMater.some(mater => mater.bucketunique === dis_dtl.bucketunique)
if (!flag) {
const flag = this.form.tableMater.some(mater => mater.storagevehicle_code !== this.form.storagevehicle_code)
if (flag) {
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
dis_dtl.storagevehicle_code = this.form.storagevehicle_code
dis_dtl.pop = false
this.form.tableMater.splice(this.form.tableMater.length, 0, dis_dtl)
if (this.form.dtl_row.assign_qty) {
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) + parseFloat(this.form.storage_qty)
} else {
this.form.dtl_row.assign_qty = parseFloat(this.form.storage_qty)
}
if (parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty) > 0) {
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty)
} else {
this.form.dtl_row.unassign_qty = 0
}
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
}
if (flag) {
this.crud.notify('该桶已被加入明细中', CRUD.NOTIFICATION_TYPE.INFO)
}
} else {
this.crud.notify('请选择桶号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
},
confirmvehicle() {
if (this.dis_row === null) {
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.dis_row.overstruct_type === '') {
this.crud.notify('载具超限不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.confirmvehicle(this.dis_row).then(res => {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('组盘成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
sectQueryChange(val) {
this.sectProp = val
if (val.length === 1) {
this.mstrow.stor_id = val[0]
this.mstrow.sect_id = ''
this.stor_id = val[0]
this.sect_id = ''
}
if (val.length === 0) {
this.mstrow.sect_id = ''
this.mstrow.stor_id = ''
this.sect_id = ''
this.stor_id = ''
}
if (val.length === 2) {
this.mstrow.stor_id = val[0]
this.mstrow.sect_id = val[1]
this.stor_id = val[0]
this.sect_id = val[1]
}
},
tabledisabled(row) {
if ((row.work_status === '00' || row.work_status === '01') && row.is_issued === '0') {
return false
} else {
return true
tableChanged(row) {
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
// 新增一行物料时,给行进行赋值
for (let i = 0; i < this.form.tableMater.length; i++) {
this.form.tableMater[i].struct_id = row.point_id
this.form.tableMater[i].struct_code = row.point_code
this.form.tableMater[i].struct_name = row.point_name
this.form.tableMater[i].region_code = row.region_code
this.form.tableMater[i].region_name = row.region_name
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
}
},
deleteRow(row) {
productOut.oneCancel(row).then(res => {
this.queryTableDtl()
})
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.currentRow = current
this.form2.unassign_qty = current.unassign_qty
this.form2.assign_qty = current.assign_qty
this.tabledis = []
if (current.bill_status === '10') {
this.button1 = false
this.button2 = true
this.button5 = false
this.button3 = false
} else if (current.bill_status === '20') {
this.button1 = false
this.button2 = false
this.button3 = false
this.button5 = false
} else if (current.bill_status === '30') {
this.button1 = true
this.button2 = false
this.button3 = true
this.button5 = false
}
this.queryTableDdis(current.iostorinvdtl_id)
} else {
this.button1 = true
this.button2 = true
this.button3 = true
this.button5 = true
this.mstrow.iostorinvdtl_id = ''
this.currentRow = {}
this.tabledis = []
}
},
handleDisCurrentChange(current) {
if (current !== null) {
this.currentDis = current
if (current.work_status === '01' || current.work_status === '00') {
this.button4 = false
} else {
this.button4 = true
}
} else {
this.button4 = true
this.mstrow.iostorinvdis_id = ''
this.currentDis = {}
}
},
allDiv() {
this.loadingAlldiv = true
productOut.allDiv(this.mstrow).then(res => {
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO)
this.queryTableDtl()
this.loadingAlldiv = false
}).catch(() => {
this.loadingAlldiv = false
})
},
oneDiv() {
this.loadingAutodiv = true
if (this.currentRow.iostorinvdtl_id !== null) {
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
productOut.allDivOne(this.mstrow).then(res => {
this.queryTableDtl()
this.loadingAutodiv = false
}).catch(() => {
this.loadingAutodiv = false
crudProductIn.divStruct(this.form).then(res => {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
this.openParam = res
})
}
},
allCancel() {
productOut.allCancel(this.mstrow).then(res => {
this.queryTableDtl()
this.form.tableMater = []
})
},
oneCancel() {
if (this.currentRow.iostorinvdtl_id !== null) {
productOut.allCancel(this.currentRow).then(res => {
this.queryTableDtl()
divPoint() {
if (!this.form.point_code) {
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.form.tableMater.length === 0) {
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.divPoint(this.form).then(res => {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
this.openParam = res
})
}
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('设置起点成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
allSetPoint() {
/* if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}*/
if (this.currentRow === '') {
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
divStruct() {
if (this.dis_row === null) {
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
})
},
queryTableDdis(iostorinvdtl_id) {
productOut.getOutBillDis({ 'iostorinvdtl_id': iostorinvdtl_id, 'bill_status': '01' }).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
})
},
cellStyle({ row, column, rowIndex, columnIndex }) {
const assign_qty = parseFloat(row.assign_qty)
const plan_qty = parseFloat(row.plan_qty)
if (column.property === 'assign_qty') {
if (assign_qty > plan_qty) {
return 'background: yellow'
// 如果勾选了,直接跳后台
if (this.form.checked) {
if (!this.sect_id) {
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.divBtn = true
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
this.form.is_pc = '1'
crudProductIn.divStruct(this.form).then(res => {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.divBtn = false
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}).finally(() => {
this.divBtn = false
})
} else {
this.structShow = true
this.$refs.child.getMsg(false)
}
},
unDivStruct() {
if (this.form.tableMater.length <= 0) {
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const flag = this.form.tableMater.some(mater => !mater.struct_code)
if (flag) {
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 如果勾选了,直接跳后台
crudProductIn.unDivStruct(this.form).then(res => {
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
this.openParam = res
})
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
}
}
}
@@ -564,18 +508,19 @@ export default {
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
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 {
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -1,164 +1,118 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
fullscreen
width="1200px"
@close="close"
@open="open"
>
<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="dialogVisible = false">关闭</el-button>
<el-button slot="left" type="primary" @click="submit">保存</el-button>
</span>
</div>
</span>
<div class="crud-opts2">
<span class="role-span" style="width: 100px">可分配库存</span>
<div class="crud-opts-form">
<el-form ref="form2" :inline="true" :model="queryrow" size="mini">
<el-form-item label="待分配" prop="unassign_qty">
<el-input-number
v-model="queryrow.unassign_qty"
:controls="false"
:precision="3"
:min="0"
disabled
/>
<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="日期">
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
</el-form-item>
<el-form-item label="已分配" prop="assign_qty">
<el-input-number
v-model="queryrow.assign_qty"
:controls="false"
:precision="3"
:min="0"
disabled
/>
</el-form-item>
<el-form-item label="库区" prop="sect_id">
<el-cascader
placeholder="请选择"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="关键字" prop="remark">
<el-form-item label="库区/货位">
<el-input
v-model="queryrow.remark"
v-model="query.bill_code"
clearable
style="width: 220px"
size="mini"
placeholder="货位编码"
prefix-icon="el-icon-search"
placeholder="单据号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="sap批次" prop="remark">
<el-form-item label="物料">
<el-input
v-model="queryrow.sap_pcsn"
v-model="query.material_search"
clearable
style="width: 220px"
size="mini"
placeholder="sap批次"
prefix-icon="el-icon-search"
placeholder="物料"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="子卷号" prop="remark">
<el-input
v-model="queryrow.pcsn"
clearable
style="width: 220px"
size="mini"
placeholder="子卷号"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-form-item>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="queryStruct">搜索</el-button>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation/>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column show-overflow-tooltip width="150" prop="sect_code" label="库区"/>
<el-table-column show-overflow-tooltip width="150" prop="struct_name" label="货位"/>
<el-table-column show-overflow-tooltip prop="material_code" width="250" label="物料编号"/>
<el-table-column show-overflow-tooltip width="100" prop="material_name" label="物料名称"/>
<el-table-column show-overflow-tooltip width="150" prop="class_name" label="物料类别"/>
<el-table-column show-overflow-tooltip width="150" prop="canuse_qty" label="重量"/>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位"/>
</el-table>
<!--分页组件-->
<pagination/>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="500"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号" align="center" width="250px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="子卷批次号" align="center" width="150px" />
<el-table-column show-overflow-tooltip sortable prop="sap_pcsn" label="sap批次" align="center" width="140px" />
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
<!-- <el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" width="160" align="center">-->
<!-- <template scope="scope">-->
<!-- <el-input-number v-show="!scope.row.edit" v-model="scope.row.plan_qty" :precision="3" :max="100000000" />-->
<!-- <span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />-->
<el-table-column align="center" label="操作" width="160" fixed="right">
<template scope="scope">
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button v-show="scope.row.edit" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header } from '@crud/crud'
// import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
import productOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
// import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
import CRUD, {crud, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
const start = new Date()
export default {
name: 'StructIvt',
components: { },
mixins: [header()],
name: 'AddDtl',
components: {crudOperation, rrOperation, pagination, DateRangePicker},
cruds() {
return CRUD({
title: '原材料可用库存',
url: '/api/stIvtStructivtYl/getRawIvt',
crudMethod: {},
optShow: {
reset: true
}
})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
},
openArray: {
type: Array,
default: () => { return [] }
},
storId: {
type: String,
default: null
}
},
data() {
return {
dialogVisible: false,
dialogVisible2: false,
goal_unassign_qty: 0,
queryrow: {},
sects: [],
tableDtl: []
rows: [],
tableData: []
}
},
watch: {
@@ -166,114 +120,37 @@ export default {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openArray: {
handler(newValue, oldValue) {
this.tableDtl = newValue
}
},
rowmst: {
handler(newValue, oldValue) {
this.queryrow = newValue
this.goal_unassign_qty = JSON.parse(JSON.stringify(this.queryrow.unassign_qty))
}
}
},
methods: {
open() {
/* crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})*/
this.query.source_bill_code = this.queryrow.source_bill_code
this.query.material_id = this.queryrow.material_id
},
queryStruct() {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(this.queryrow.assign_qty)
this.queryrow.assign_qty = 0
/* productOut.getStructIvt(this.queryrow).then(res => {
this.tableDtl = res
})*/
},
sectQueryChange(val) {
if (val.length === 1) {
this.queryrow.stor_id = val[0]
this.queryrow.sect_id = ''
}
if (val.length === 0) {
this.queryrow.sect_id = ''
this.queryrow.stor_id = ''
}
if (val.length === 2) {
this.queryrow.stor_id = val[0]
this.queryrow.sect_id = val[1]
}
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
if (row.edit === undefined) {
this.$set(row, 'edit', false)
}
row.edit = !row.edit
if (row.edit) {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
} else {
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
// 如果待分配重量等于0则 明细重量 - 已分配重量
if (parseInt(this.queryrow.unassign_qty) === 0) {
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
objectSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
}
} else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
}
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
}
// 如果已分配汇总量 > 明细重量 则待分配重量为0
if (this.queryrow.assign_qty > this.goal_unassign_qty) {
this.queryrow.unassign_qty = parseFloat('0')
return {
rowspan: 0,
colspan: 0
}
}
}
this.tableDtl.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
},
open() {
this.crud.toQuery()
},
close() {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
},
submit() {
if (parseFloat(this.queryrow.assign_qty) === 0) {
this.crud.notify('请分配后再提交', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (parseFloat(this.queryrow.unassign_qty) === 0) {
const rows = []
this.tableDtl.forEach((item) => {
if (item.edit) {
rows.push(item)
}
})
productOut.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
} else {
this.$confirm('未分配重量不为0,是否继续提交?')
.then(_ => {
const rows = []
this.tableDtl.forEach((item) => {
if (item.edit) {
rows.push(item)
}
})
productOut.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
})
.catch(_ => {
})
}
this.$emit('update:dialogShow', false)
this.rows = this.$refs.multipleTable.selection
this.$emit('setMaterValue', this.rows)
// this.form = this.$options.data().form
}
}
}
</script>

View File

@@ -2,17 +2,18 @@
<template>
<el-dialog
append-to-body
title="出库单详情"
title="入库详情"
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
:model="form" 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-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
</el-form-item>
<el-form-item label="生产车间">
<el-select
@@ -32,18 +33,19 @@
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="bill_type">
<el-form-item label="业务类型">
<el-select
v-model="form.bill_type"
clearable
filterable
size="mini"
:disabled="true"
placeholder="业务类型"
class="filter-item"
disabled
@change="crud.toQuery"
>
<el-option
v-for="item in dict.bill_type"
v-for="item in dict.ST_INV_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -60,7 +62,7 @@
disabled
>
<el-option
v-for="item in dict.io_bill_status"
v-for="item in dict.IO_BILL_STATUS"
:key="item.id"
:label="item.label"
:value="item.value"
@@ -69,7 +71,7 @@
</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-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>
@@ -83,15 +85,16 @@
/>
</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="true" />
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"
value-format="yyyy-MM-dd" :disabled="true"/>
</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="true" />
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true"/>
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span2">库明细</span>
<span class="role-span2">库明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
@@ -106,43 +109,13 @@
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
<el-table-column min-width="140" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column prop="pcsn" label="订单号" width="150px" align="center" show-overflow-tooltip />
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="assign_qty" :formatter="crud.formatNum3" label="已分配重量" align="center" width="100px" />
<el-table-column prop="unassign_qty" :formatter="crud.formatNum3" label="未分配重量" align="center" width="100px" />
<el-table-column prop="qty_unit_name" label="单位" align="center" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="tabledis"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column prop="pcsn" label="订单号" align="center" show-overflow-tooltip />
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
<el-table-column prop="struct_code" label="仓位" align="center" show-overflow-tooltip />
<el-table-column prop="region_code" label="区域" align="center" show-overflow-tooltip />
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center"/>
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center"/>
<el-table-column prop="pcsn" label="订单号" width="150" align="center"/>
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center"/>
<el-table-column prop="qty_unit_name" label="单位" align="center"/>
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center"/>
</el-table>
</el-card>
</el-dialog>
@@ -150,15 +123,14 @@
<script>
import { crud } from '@crud/crud'
import productOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
import {crud} from '@crud/crud'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
export default {
name: 'ViewDialog',
components: { },
components: {},
mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'bill_type', 'product_area'],
dicts: ['ST_INV_IN_TYPE', 'product_area', 'IO_BILL_STATUS'],
props: {
dialogShow: {
type: Boolean,
@@ -173,6 +145,7 @@ export default {
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
@@ -191,11 +164,6 @@ export default {
}
}
},
created() {
crudProductIn.queryStor().then(res => {
this.storlist = res
})
},
methods: {
open() {
this.queryTableDtl()
@@ -206,10 +174,10 @@ export default {
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('AddChanged')
this.$emit('TaskChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
@@ -241,13 +209,13 @@ export default {
this.currentDis = current
},
queryTableDtl() {
productOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
crudProductIn.getIODtl({'iostorinv_id': this.form.iostorinv_id}).then(res => {
this.tableDtl = res
})
},
queryTableDdis() {
if (this.currentdtl !== null) {
productOut.getOutBillDis({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
crudProductIn.getDisTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
this.tabledis = res
}).catch(() => {
this.tabledis = []
@@ -268,13 +236,14 @@ export default {
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
font-size: 20px;
color: #303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}

View File

@@ -12,26 +12,37 @@
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-form-item label="仓库">
<el-select
v-model="query.product_code"
v-model="query.stor_id"
clearable
size="mini"
placeholder="全部"
placeholder="仓库"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
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-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_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -39,6 +50,37 @@
</el-select>
</el-form-item>
<el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
clearable
filterable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_CREATE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</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.bill_status"
@@ -57,36 +99,35 @@
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
clearable
filterable
<el-form-item label="入库单号">
<el-input
v-model="query.bill_code"
size="mini"
placeholder="业务类型"
clearable
placeholder="入库单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="车间">
<el-select
v-model="query.workshop_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_OUT_TYPE"
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</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>
<rrOperation />
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -94,22 +135,10 @@
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="dis_flag"
@click="divOpen"
>
分配
</el-button>
<el-button
slot="right"
class="filter-item"
:loading="loadingConfirm"
type="warning"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
:disabled="confirm_flag"
@click="confirm"
>
强制确认
@@ -121,13 +150,39 @@
v-loading="crud.loading"
size="mini"
:data="crud.data"
highlight-current-row
style="width: 100%;"
:highlight-current-row="true"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column 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 prop="stor_name" label="生产车间" width="130" show-overflow-tooltip/>
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="业务类型"
:formatter="bill_typeFormat"/>
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期"/>
<el-table-column label="明细数量" align="center" prop="detail_count"/>
<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="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,113 +193,86 @@
/>
</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 />
<pagination/>
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :stor-id="storId" :rowmst="mstrow" @DivChanged="querytable" />
<AddDialog @AddChanged="querytable"/>
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable"/>
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" @AddChanged="querytable"/>
</div>
</template>
<script>
import productOut from '@/views/wms/storage_manage/product/productOut/productout'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rawProductOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
import crudProductOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
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 DateRangePicker from '@/components/DateRangePicker/index'
import AddDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/AddDialog'
import DivDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/DivDialog'
import ViewDialog from '@//views/wms/storage_manage/rawproduct/rawProductOut/ViewDialog'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
import ViewDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/ViewDialog'
import {mapGetters} from 'vuex'
import crudStorattr from "@/api/wms/basedata/st/storattr";
export default {
name: 'ProductOut',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog },
name: 'RawProductOut',
components: {ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog},
cruds() {
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/productOut', crudMethod: { ...productOut },
optShow: {
add: true,
edit: false,
del: false,
reset: true,
download: false
}})
return CRUD({
title: '',
optShow: {add: true, reset: true},
idField: 'iostorinv_id',
url: '/api/out/stIvtIostorinvYl',
sort: ['bill_code,desc'],
crudMethod: {...rawProductOut}
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['IO_BILL_STATUS', 'ST_INV_OUT_TYPE', 'product_area'],
dicts: ['IO_BILL_STATUS', 'ST_INV_IN_TYPE', 'product_area', 'ST_INV_CREATE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'checkoutbill:add'],
edit: ['admin', 'checkoutbill:edit'],
del: ['admin', 'checkoutbill:del']
},
openMoneyDialog: false,
loadingConfirm: false,
divShow: false,
taskShow: false,
permission: {},
dis_flag: true,
work_flag: true,
confirm_flag: true,
openParam: [],
openParamMoney: null,
mstrow: {},
disShow: false,
viewShow: false,
mstrow: {},
divShow: false,
openParam: [],
currentRow: null,
checkrows: [],
billtypelist: [],
storlist: [],
storId: null
}
},
mounted: function() {
computed: {
...mapGetters([
'user'
])
},
mounted: function () {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudProductIn.queryStor().then(res => {
this.storlist = res
crudStorattr.queryStor({"stor_type": "3"}).then(res => {
this.storlist = res.content
})
},
methods: {
fun(val) {
return Number(val).toFixed(3)
},
canUd(row) {
return row.bill_status !== '10'
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
[CRUD.HOOK.beforeRefresh]() {
this.handleCurrentChange(null)
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
@@ -260,60 +288,55 @@ export default {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(current) {
if (current !== null) {
this.currentRow = current
if (current.bill_status === '10' || current.bill_status === '20' || current.bill_status === '30') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (current.bill_status === '30') {
buttonChange(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
}
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
bill_typeFormat(row) {
return this.dict.label.ST_INV_OUT_TYPE[row.bill_type]
},
handleCurrentChange(current) {
if (current === null) {
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.dis_flag = true
this.confirm_flag = true
this.work_flag = true
this.currentRow = {}
}
},
checkboxT(row) {
return row.bill_status !== '99'
bill_typeFormat(row, column) {
return this.dict.label.ST_INV_IN_TYPE[row.bill_type]
},
divOpen() {
productOut.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.storId = this.currentRow.product_code
this.divShow = true
this.mstrow = this.currentRow
})
toView(row) {
this.mstrow = row
this.viewShow = true
},
confirm() {
this.loadingConfirm = true
productOut.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.querytable()
this.crud.notify('出库成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.loadingConfirm = false
}).catch(() => {
this.loadingConfirm = false
if (!this.currentRow) {
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.confirm(this.currentRow).then(res => {
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
stateFormat(row, column) {
return this.dict.label.IO_BILL_STATUS[row.bill_status]
},
divOpen() {
crudProductIn.getIODtl({'bill_code': this.currentRow.bill_code, 'open_flag': '1'}).then(res => {
this.openParam = res
debugger
this.storId = this.currentRow.product_code
this.billType = this.currentRow.bill_type
this.divShow = true
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
}
}
}