This commit is contained in:
2022-07-01 09:14:57 +08:00
parent 4d9d6fbe8f
commit 8c86db4f8f
21 changed files with 1919 additions and 209 deletions

View File

@@ -48,7 +48,9 @@
</el-form-item>
<el-form-item label="关联设备" prop="bizperson">
<label slot="label">关联设备:</label>
<el-input v-model="form.bizperson" size="mini" style="width: 210px"/>
<el-input v-model="form.device_code" size="mini" style="width: 210px">
<el-button slot="append" icon="el-icon-plus" @click="putDevice"/>
</el-input>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
@@ -68,13 +70,18 @@
/>
</el-select>
</el-form-item>
<el-form-item label="业务部门" prop="bizperson">
<label slot="label">业务部门:</label>
<el-input v-model="form.bizperson" size="mini" style="width: 210px"/>
<el-form-item label="业务部门" prop="bizdeptid">
<treeselect
v-model="form.bizdeptid"
:options="depts"
:load-options="loadDepts"
style="width: 200px"
placeholder="选择部门"
/>
</el-form-item>
<el-form-item label="业务人员" prop="bizperson">
<label slot="label">业务人员:</label>
<el-input v-model="form.bizperson" size="mini" style="width: 210px"/>
<el-input v-model="form.bizperson" size="mini" style="width: 210px"/>
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
@@ -176,12 +183,9 @@
</template>
</el-table-column>
</el-table>
<MaterDtl
:dialog-show.sync="materShow"
:is-single="true"
:mater-opt-code="materType"
@tableChanged2="tableChanged2"
/>
<MaterDtl :dialog-show.sync="materShow" :is-single="true" :mater-opt-code="materType"
@tableChanged2="tableChanged2"/>
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged"/>
</el-dialog>
</template>
@@ -192,7 +196,10 @@ import crudStorattr from '@/api/wms/basedata/st/storattr'
import sparePart from '@/api/wms/sb/sparepartout'
import crudRawAssist from '@/api/wms/st/core/inbill/rawassist'
import MaterDtl from '@/views/wms/sb/outbill/IvtDialog'
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
import DeviceDialog from '@/views/wms/sb/upkeep/devicemaintenanceplan/DeviceDialog'
import { getDepts, getDeptSuperior } from '@/api/system/dept'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
const defaultForm = {
bill_code: '',
@@ -202,6 +209,10 @@ const defaultForm = {
detail_count: '0',
bill_type: '',
remark: '',
device_code: '',
device_id: '',
bizdeptid: null,
device_name: '',
bizperson: '',
source_id: '',
biz_date: new Date().format('yyyy-MM-dd'),
@@ -211,7 +222,7 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { crudOperation, MaterDtl },
components: { crudOperation, MaterDtl, DeviceDialog, Treeselect },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
@@ -233,7 +244,9 @@ export default {
opendtlParam: null,
mater_btn: false,
materType: '',
deviceDialog: false,
storlist: [],
depts: [],
billtypelist: [],
rules: {
stor_id: [
@@ -264,7 +277,7 @@ export default {
this.mater_btn = true
}
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({ 'is_attachment': '1' }).then(res => {
this.storlist = res.content
this.form.stor_id = this.storlist[0].stor_id
})
@@ -274,6 +287,59 @@ export default {
this.form.bill_type = this.billtypelist[0].code
})
},
[CRUD.HOOK.afterToCU](crud, form) {
if (!form.bill_code) {
this.getDepts()
} else {
debugger
this.getSupDepts(form.bizdeptid)
}
},
getDepts() {
getDepts({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
getSupDepts(deptId) {
var number = parseFloat(deptId)
getDeptSuperior(number).then(res => {
const date = res.content
this.buildDepts(date)
this.depts = date
})
},
buildDepts(depts) {
debugger
depts.forEach(data => {
if (data.children) {
this.buildDepts(data.children)
}
if (data.hasChildren && !data.children) {
data.children = null
}
})
},
// 获取弹窗内部门数据
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 200)
})
}
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
sparePart.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
@@ -300,6 +366,9 @@ export default {
}
}
},
putDevice() {
this.deviceDialog = true
},
billTypeChange(val) {
this.form.tableData = []
this.form.total_qty = 0
@@ -318,16 +387,15 @@ export default {
this.nowrow.sum_qty = row.sum_qty
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
fun(val) {
return Number(val).toFixed(3)
tableChanged(row) {
this.form.device_id = row.devicerecord_id
this.form.device_code = row.device_code
this.form.device_name = row.device_name
},
async queryMater(index, row) {
checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type, 'io_flag': '01' }).then(res => {
this.materType = res.materType
this.materShow = true
this.nowindex = index
this.nowrow = row
})
this.materShow = true
this.nowindex = index
this.nowrow = row
},
async insertdtl() {
if (this.form.bill_type == '') {
@@ -364,26 +432,6 @@ export default {
rows.splice(index, 1)
this.form.detail_count = this.form.tableData.length
},
tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.material_id === item.material_id && row.pcsn === item.pcsn) {
same_mater = false
}
})
if (same_mater) {
item.edit = false
item.quality_scode = '00'
item.is_active = '1'
item.plan_qty = item.need_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
},
close() {
this.$emit('AddChanged')
}

View File

@@ -56,8 +56,10 @@
<el-table-column show-overflow-tooltip prop="material_spec" label="规格" align="center"/>
<el-table-column show-overflow-tooltip prop="material_model" 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="assign_qty" :formatter="crud.formatNum3" label="已出数量" align="center"/>
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未出数量" align="center"/>
<el-table-column show-overflow-tooltip prop="assign_qty" :formatter="crud.formatNum3" label="已出数量"
align="center"/>
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未出数量"
align="center"/>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center"/>
</el-table>
</el-card>
@@ -98,6 +100,16 @@
>
删除分配
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="disConfirm()"
>
确认
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
@@ -122,7 +134,8 @@
</el-table>
</el-card>
<StructIvt :dialog-show.sync="structShow" :open-array="ivtParam" :rowmst="openRow" @StructIvtClosed="queryTableDtl"/>
<StructIvt :dialog-show.sync="structShow" :open-array="ivtParam" :rowmst="openRow"
@StructIvtClosed="queryTableDis"/>
</el-dialog>
</template>
@@ -257,15 +270,12 @@ export default {
})
},
cancelCreate() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
return
const rows = this.$refs.dis_table.selection
if (rows.length === 0) {
this.crud.notify('请至少选择一条分配记录', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form.dtl_row.bill_status !== '40') {
this.crud.notify('请选择状态为分配完的明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
sparePart.cancelCreate(this.form).then(res => {
sparePart.cancelCreate({ rows: rows, row: this.form.dtl_row }).then(res => {
sparePart.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
this.openParam = res
})
@@ -280,6 +290,11 @@ export default {
this.openParam = res
})
},
queryTableDis() {
sparePart.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
})
},
disConfirm() {
debugger
let rows = this.$refs.dis_table.selection

View File

@@ -29,7 +29,7 @@
disabled
/>
</el-form-item>
<el-form-item label="待分配" prop="unassign_qty">
<el-form-item label="需出数" prop="unassign_qty">
<el-input-number
v-model="queryrow.unassign_qty"
:controls="false"
@@ -58,11 +58,11 @@
</el-form-item>
<el-form-item label="关键字" prop="remark">
<el-input
v-model="queryrow.remark"
v-model="queryrow.search"
clearable
style="width: 220px"
size="mini"
placeholder="货位编码、名称或载具号"
placeholder="货位编码、名称或唯一标识"
prefix-icon="el-icon-search"
class="filter-item"
/>
@@ -77,6 +77,7 @@
:data="tableDtl"
style="width: 100%;"
max-height="400"
@selection-change="changeNum"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@@ -99,7 +100,7 @@
import CRUD, { header } from '@crud/crud'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
import sparePart from '@/api/wms/sb/sparepartout'
export default {
name: 'StructIvt',
@@ -146,14 +147,12 @@ export default {
},
methods: {
open() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
crudSectattr.getSect({ is_attachment: '1' }).then(res => {
this.sects = res.content
})
},
queryStruct() {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(this.queryrow.assign_qty)
this.queryrow.assign_qty = 0
checkoutbill.getStructIvt(this.queryrow).then(res => {
sparePart.getStructIvt(this.queryrow).then(res => {
this.tableDtl = res
})
},
@@ -171,31 +170,8 @@ export default {
this.queryrow.sect_id = val[1]
}
},
handleEdit(index, row) {
// 判断是否可以关闭编辑状态
if (!row.edit) {
if (row.plan_qty > this.queryrow.unassign_qty) {
this.crud.notify('出库重量不能超过未分配数', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.plan_qty > row.canuse_qty) {
this.crud.notify('出库重量不能超过库存可出重量', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (row.plan_qty === 0) {
this.crud.notify('出库重量为0不能保存', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
row.edit = !row.edit
if (row.edit) {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - row.plan_qty
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + row.plan_qty
} else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + row.plan_qty
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - row.plan_qty
}
this.tableDtl.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
changeNum(rows) {
this.queryrow.assign_qty = rows.length
},
close() {
this.$emit('update:dialogShow', false)
@@ -206,35 +182,15 @@ export default {
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)
}
})
checkoutbill.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)
}
})
checkoutbill.manualDiv({ 'row': this.queryrow, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
})
.catch(_ => {
})
if (parseFloat(this.queryrow.assign_qty) > parseFloat(this.queryrow.unassign_qty)) {
this.crud.notify('分配数需小于等于需出数', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
const rows = this.$refs.table.selection
sparePart.insertDis({ 'row': this.queryrow, 'rows': rows }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('StructIvtClosed')
})
}
}
}

View File

@@ -95,7 +95,7 @@
/>
</el-select>
</el-form-item>
<rrOperation />
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -109,7 +109,7 @@
size="mini"
@click="divOpen"
>
备件入库
出库分配
</el-button>
<el-button
slot="right"
@@ -136,7 +136,7 @@
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column type="selection" width="55"/>
<el-table-column
label="操作"
width="115"
@@ -157,8 +157,8 @@
<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" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态"/>
<el-table-column prop="stor_name" label="仓库"/>
<el-table-column
show-overflow-tooltip
prop="bill_type"
@@ -166,30 +166,30 @@
:formatter="bill_typeFormat"
label="业务类型"
/>
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" label="生成方式" />
<el-table-column label="明细数" align="center" prop="detail_count" />
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期"/>
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" 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="input_optname" />
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_optname" />
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
<el-table-column label="分配人" align="center" prop="dis_optname" />
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="制单人" align="center" prop="input_optname"/>
<el-table-column label="制单时间" align="center" prop="input_time" width="150"/>
<el-table-column label="修改人" align="center" prop="update_optname"/>
<el-table-column label="修改时间" align="center" prop="update_time" width="150"/>
<el-table-column label="分配人" align="center" prop="dis_optname"/>
<el-table-column label="分配时间" align="center" prop="dis_time" width="150"/>
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150"/>
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150"/>
</el-table>
<!--分页组件-->
<pagination />
<pagination/>
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-param="openParam" :bill-type="billType" :buss-config="bussConfig" @AddChanged="querytable" />
<AddDialog @AddChanged="querytable"/>
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable"/>
<DivDialog :dialog-show.sync="divShow" :open-param="openParam" :bill-type="billType" :buss-config="bussConfig" @AddChanged="querytable"/>
</div>
</template>
@@ -210,7 +210,16 @@ import crudStorattr from '@/api/wms/basedata/st/storattr'
export default {
name: 'Handle',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog },
components: {
ViewDialog,
AddDialog,
crudOperation,
rrOperation,
udOperation,
pagination,
DateRangePicker,
DivDialog
},
cruds() {
return CRUD({
title: '',
@@ -273,7 +282,7 @@ export default {
canUd(row) {
return row.bill_status !== '10'
},
toView(index,row){
toView(index, row) {
this.mstrow = row
this.viewShow = true
},