代码更新
This commit is contained in:
@@ -110,7 +110,19 @@
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="info"
|
||||
:loading="syncLoading"
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="sync()"
|
||||
>
|
||||
仓位同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
size="mini"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
添加质检物料
|
||||
添加物料
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
@@ -142,7 +142,6 @@
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="bill_status" label="订单状态" align="center" :formatter="bill_statusFormat" />
|
||||
<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">
|
||||
@@ -152,19 +151,20 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" 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">
|
||||
<el-table-column prop="plan_qty" label="出库重量" width="150" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number v-model="scope.row.plan_qty" :disabled="scope.row.edit" :precision="3" :controls="false" :min="0" style="width: 120px" />
|
||||
<el-input-number v-model="scope.row.plan_qty" v-show="!scope.row.edit" :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 prop="quality_scode" label="品质类型" align="center" width="110px">
|
||||
<!-- <el-table-column prop="quality_scode" label="品质类型" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.quality_scode"
|
||||
@@ -212,27 +212,25 @@
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.remark" size="mini" />
|
||||
<span v-show="scope.row.edit">{{ scope.row.remark }}</span>
|
||||
<el-input v-model="scope.row.remark" size="mini" />
|
||||
<span>{{ scope.row.remark }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<AddDtl :dialog-show.sync="dtlShow" :open-param="materType" @tableChanged="tableChanged" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -279,7 +277,9 @@ export default {
|
||||
nowrow: {},
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
billtypelist: [
|
||||
{ 'name': '发货出库', 'code': '111111' }
|
||||
],
|
||||
invtypelist: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
@@ -304,19 +304,25 @@ export default {
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
crudRawAssist.getType({ 'io_code': '0101', 'io_flag': '01' }).then(res => {
|
||||
/* crudRawAssist.getType({ 'io_code': '0101', 'io_flag': '01' }).then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
checkoutbill.getInvTypes().then(res => {
|
||||
this.invtypelist = res
|
||||
})
|
||||
})*/
|
||||
},
|
||||
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]() {
|
||||
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
@@ -346,9 +352,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
bill_statusFormat(row, column) {
|
||||
return this.dict.label.io_bill_status[row.bill_status]
|
||||
},
|
||||
storChange(row) {
|
||||
this.storlist.forEach((item) => {
|
||||
if (item.stor_id === row) {
|
||||
@@ -362,22 +365,22 @@ export default {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
|
||||
this.materType = res.materType
|
||||
this.materShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
})
|
||||
this.materShow = true
|
||||
/* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
|
||||
this.materType = res.materType
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
})*/
|
||||
},
|
||||
async queryDtl(index, row) {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
|
||||
this.materType = res.materType
|
||||
this.dtlShow = true
|
||||
})
|
||||
this.dtlShow = true
|
||||
/* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
|
||||
this.materType = res.materType
|
||||
})*/
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
@@ -392,17 +395,11 @@ export default {
|
||||
if (!this.flagnow) {
|
||||
item.edit = true
|
||||
item.quality_scode = '00'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.bill_status = '10'
|
||||
tablemap.set(item.material_id, item)
|
||||
}
|
||||
} else {
|
||||
item.edit = true
|
||||
item.quality_scode = '00'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.bill_status = '10'
|
||||
tablemap.set(item.material_id, item)
|
||||
}
|
||||
})
|
||||
@@ -411,7 +408,7 @@ export default {
|
||||
}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
tableChanged2(row) {
|
||||
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('不允许添加相同物料!')
|
||||
@@ -423,6 +420,8 @@ export default {
|
||||
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() {
|
||||
@@ -430,56 +429,15 @@ export default {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.form.tableData.push({ material_id: '', material_code: '', bill_status: '10', material_name: '', pcsn: '', quality_scode: '00', ivt_level: '01', is_active: '1', plan_qty: '2', qty_unit_name: '', qty_unit_id: '', remark: '', edit: false })
|
||||
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
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (!row.edit) {
|
||||
if (!row.material_id || !row.plan_qty || parseFloat(row.plan_qty) <= 0) {
|
||||
this.crud.notify('物料、数量不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (row.quality_scode !== '00') {
|
||||
this.crud.notify('请校验物料' + row.material_code + ',品质类型是否正确', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (row.ivt_level !== '01') {
|
||||
this.crud.notify('请校验物料' + row.material_code + ',库存等级是否正确', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (row.is_active !== '1') {
|
||||
this.crud.notify('请校验物料' + row.material_code + ',是否可用是否正确', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
row.edit = !row.edit
|
||||
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
if (row.edit) {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = this.form.total_qty + item.plan_qty
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = {}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (!this.form.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,19 +14,19 @@
|
||||
<!-- 搜索 -->
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="质检单号模糊查询"
|
||||
placeholder="物料编码、名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.remark"
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料"
|
||||
placeholder="子卷号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -44,12 +44,12 @@
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="biz_date" label="日期" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="单据号" />
|
||||
<el-table-column show-overflow-tooltip prop="instorage_time" label="入库日期" />
|
||||
<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="pcsn" label="批次" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="检测重量" />
|
||||
<el-table-column show-overflow-tooltip prop="box_no" label="箱号" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" />
|
||||
<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>
|
||||
<!--分页组件-->
|
||||
|
||||
@@ -111,8 +111,6 @@
|
||||
<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 prop="quality_scode" label="品质类型" align="center" width="110px" :formatter="quality_scodeFormat" />
|
||||
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
|
||||
<el-table-column prop="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
@@ -193,12 +191,12 @@
|
||||
</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="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_name" label="出库点" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="出库点" align="center" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" />
|
||||
|
||||
@@ -78,9 +78,9 @@
|
||||
<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" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷批次号" align="center" />
|
||||
<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">
|
||||
@@ -176,7 +176,11 @@ export default {
|
||||
}
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
debugger
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (row.edit === undefined) {
|
||||
row.edit = false
|
||||
}
|
||||
if (!row.edit) {
|
||||
if (row.plan_qty > this.queryrow.unassign_qty) {
|
||||
this.crud.notify('出库重量不能超过未分配数', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
|
||||
@@ -135,14 +135,13 @@
|
||||
>
|
||||
<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="批次号" align="center" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
|
||||
<el-table-column prop="bucket_num" label="桶数" :formatter="crud.formatNum0" align="center" />
|
||||
<el-table-column prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="pcsn" label="子卷批次号" align="center" />
|
||||
<el-table-column prop="storagevehicle_code" label="箱号" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="start_point_code" label="起始位置" align="center" />
|
||||
<el-table-column prop="next_point_code" label="目的位置" align="center" />
|
||||
<el-table-column prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
</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="订单编码">
|
||||
<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>
|
||||
@@ -270,7 +270,6 @@ export default {
|
||||
this.viewShow = true
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.buss_type = '0101'
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
|
||||
Reference in New Issue
Block a user