add:刻字缓存物料维护/物料信息

This commit is contained in:
zhangzhiqiang
2023-06-24 19:05:54 +08:00
parent 4612ce74f5
commit d9125962b2
35 changed files with 1180 additions and 267 deletions

View File

@@ -55,7 +55,6 @@
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="product_area" label="生产车间" width="100px" show-overflow-tooltip />
@@ -85,8 +84,15 @@
</el-table-column>
</el-table>
<!--分页组件-->
<MaterDtl
:dialog-show.sync="materialShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<pagination />
</el-card>
</div>
</template>
@@ -96,12 +102,13 @@ import CRUD, { presenter, header, form } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import MaterDtl from '@/views/wms/pub/MaterDialog'
const defaultForm = { product_area: 'A1', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
export default {
name: 'SKdevice',
components: { crudOperation, pagination, rrOperation },
components: { crudOperation, pagination, rrOperation, MaterDtl },
dicts: ['product_area'],
cruds() {
return [
@@ -111,6 +118,7 @@ export default {
mixins: [presenter(), header(), form(defaultForm)],
data() {
return {
materType: '',
materialShow: false,
queryTypeOptions: [
{ key: 'name', display_name: '字典名称' },
@@ -129,6 +137,13 @@ export default {
}
},
methods: {
setMaterValue(row) {
this.nowrow.material_id = row.material_id
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.nowrow.material_spec = row.material_spec
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
queryMater(index, row) {
this.materialShow = true
this.nowindex = index

View File

@@ -68,6 +68,40 @@
</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
:visible.sync=dialogVisible
title="载具物料信息"
width="540px"
@close="materiValueCancel()"
>
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
<el-form-item label="载具编码" prop="vehicle_code">
<el-input v-model="materialForm.storagevehicle_code" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="物料编码" prop="material_code">
<template slot-scope="scope">
<el-input v-model="materialForm.material_code" clearable style="width: 370px">
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
</el-input>
</template>
</el-form-item>
<el-form-item label="物料规格" prop="material_spec">
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="物料数量" prop="storage_qty">
<el-input v-model="materialForm.storage_qty" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="物料重量" prop="weight">
<el-input v-model="materialForm.weight" clearable style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="materiValueCancel()">取消</el-button>
<el-button type="primary" @click="materiValueSubmit()">确认</el-button>
</div>
</el-dialog>
<el-dialog
:before-close="crud.cancelCU"
:close-on-click-modal="false"
@@ -123,7 +157,11 @@
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="storagevehicle_id" label="载具标识" />
<el-table-column prop="storagevehicle_type_name" label="载具类型" />
<el-table-column prop="storagevehicle_code" label="载具编码" />
<el-table-column prop="storagevehicle_code" label="载具编码" >
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row.storagevehicle_code)">{{ scope.row.storagevehicle_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="storagevehicle_name" label="载具名称" />
<el-table-column label="是否启用" align="center" prop="is_used">
<template slot-scope="scope">
@@ -154,19 +192,27 @@
</el-table-column>
</el-table>
<!--分页组件-->
<MaterDtl
:dialog-show.sync="materialShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<pagination />
</div>
</div>
</template>
<script>
import crudStoragevehicleinfo from '@/api/wms/basedata/master/storagevehicleinfo'
import crudStoragevehicleinfo from '@/views/wms/masterdata_manage/master/storagevehicleinfo/storagevehicleinfo'
import CRUD, { crud, form, 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 { getLodop } from '@/assets/js/lodop/LodopFuncs'
import MaterDtl from '@/views/wms/pub/MaterDialog'
const defaultForm = {
storagevehicle_id: null,
@@ -195,7 +241,7 @@ const defaultForm = {
export default {
name: 'Storagevehicleinfo',
dicts: ['storagevehicle_type'],
components: { pagination, crudOperation, rrOperation, udOperation },
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -224,6 +270,10 @@ export default {
}
}
return {
materType:'',
materialShow: false,
dialogVisible: false,
materialForm: {},
resultCodeArr: [],
permission: {},
rules: {
@@ -263,6 +313,30 @@ export default {
[CRUD.HOOK.beforeRefresh]() {
return true
},
queryMater(index, row) {
this.materialShow = true
this.nowindex = index
this.nowrow = row
},
setMaterValue(row) {
this.materialForm.material_id = row.material_id
this.materialForm.material_code = row.material_code
this.materialForm.material_name = row.material_name
this.materialForm.material_spec = row.material_spec
},
materiValueCancel(){
this.materialForm = {}
this.dialogVisible = false
},
materiValueSubmit(){
console.log(this.materialForm)
crudStoragevehicleinfo.updateVehicleMaterial(this.materialForm).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.materiValueCancel()
}).catch(() => {
})
},
hand(value) {
this.crud.toQuery()
},
@@ -308,6 +382,12 @@ export default {
this.crud.toQuery()
}
},
toView(row) {
crudStoragevehicleinfo.vehileInfo(row).then(data => {
this.dialogVisible = true
this.materialForm = data
})
},
addAndprint() {
const data = this.form
if (!this.form.storagevehicle_type) {

View File

@@ -0,0 +1,56 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/storagevehicleinfo',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/storagevehicleinfo/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/storagevehicleinfo',
method: 'put',
data
})
}
export function changeActive(data) {
return request({
url: 'api/storagevehicleinfo/changeActive',
method: 'put',
data
})
}
export function getVehicle(code) {
return request({
url: 'api/storagevehicleinfo/getVehicle/' + code,
method: 'get'
})
}
export function vehileInfo(data) {
return request({
url: 'api/storagevehicleinfo/vehicleInfo?vehicle_code='+data,
method: 'get',
})
}
export function updateVehicleMaterial(data) {
return request({
url: 'api/storagevehicleinfo/updateVehicleMaterial',
method: 'post',
data
})
}
export default { add, edit, del, changeActive, getVehicle, vehileInfo, updateVehicleMaterial }

View File

@@ -227,6 +227,7 @@ export default {
produce_date: date,
plan_qty: '',
real_qty: '',
is_used_fxx: false,
report_qty: '',
material_id: '',
material_code: '',

View File

@@ -363,6 +363,15 @@
>{{ item.label }}
</el-radio>
</el-form-item>
<el-form-item v-show="form.workprocedure_id == '1535144822984282112'" label="是否启用封箱线" prop="is_used_fxx">
<el-radio
v-for="item in dict.IS_OR_NOT"
:key="item.id"
v-model="form.is_used_fxx"
:label="item.value"
>{{ item.label }}
</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
@@ -495,6 +504,7 @@ const defaultForm = {
device_code: null,
current_produce_person_id: null,
is_canupdate_update: null,
is_used_fxx: false,
workorder_status: null,
is_needmove: null,
sale_id: null,
@@ -604,7 +614,7 @@ export default {
this.crud.toQuery()
},
getNotWorkDeviceByWorkproceduceId(workprocedure_id) { // 根据工序标识获取设备列表
crudProduceshiftorder.getNotWorkDeviceByWorkproceduceId({ workprocedure_id: workprocedure_id }).then(res => {
crudProduceshiftorder.getNotWorkDeviceByWorkproceduceId({ workprocedure_id: workprocedure_id,product_area:this.form.product_area }).then(res => {
this.deviceList = res.content
})
},

View File

@@ -0,0 +1,144 @@
<template>
<el-dialog
title="点位详情"
append-to-body
fullscreen
:visible.sync="dialogVisible"
@open="open"
@close="close"
>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span style="font-weight: bold;font-size: 15px;">点位信息:</span>
<!-- <el-button style="float: right; padding: 3px 10px;" type="text">操作按钮</el-button>-->
</div>
<el-form ref="form" disabled :inline="true" :model="form" :rules="rules" size="mini" label-width="100px">
<el-form-item label="区域编码">
<el-input v-model="form.region_code" style="width: 200px;"/>
</el-form-item>
<el-form-item label="区域名称">
<el-input v-model="form.region_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="点位编码">
<el-input v-model="form.point_code" style="width: 200px;"/>
</el-form-item>
<el-form-item label="点位名称">
<el-input v-model="form.point_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="点位类型">
<el-input v-model="form.point_type_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="点位状态">
<el-input v-model="form.point_status_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="锁定类型">
<el-input v-model="form.lock_type_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="载具类型">
<el-input v-model="form.lock_type_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="载具编码">
<el-input v-model="form.vehicle_code" style="width: 200px;"/>
</el-form-item>
<el-form-item label="载具数量">
<el-input v-model="form.vehicle_qty" style="width: 200px;"/>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card" shadow="always">
<div slot="header" class="clearfix">
<span style="font-weight: bold;font-size: 15px;">载具物料信息:</span>
</div>
<el-form ref="form" :inline="true" :model="form2" :rules="rules" size="mini" label-width="100px">
<el-form-item label="物料编号">
<el-input v-model="form2.material_code" style="width: 200px;"/>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="form2.material_name" style="width: 200px;"/>
</el-form-item>
<el-form-item label="物料规格">
<el-input v-model="form2.material_spec" style="width: 200px;"/>
</el-form-item>
<el-form-item label="物料批次">
<el-input v-model="form2.pcsn" style="width: 200px;"/>
</el-form-item>
<el-form-item label="物料数量">
<el-input v-model="form2.storage_qty" style="width: 200px;"/>
</el-form-item>
<el-form-item label="物料重量">
<el-input v-model="form2.weight" style="width: 200px;"/>
</el-form-item>
</el-form>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import crudDevice from '@/views/wms/staging_manage/staging/kzStaging/kzStaging.js'
export default {
name: 'ViewDialog',
components: {},
dicts: [],
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
classes3: [],
parentData: {},
form: {},
form2: {},
workprocedureList: [],
tableData: [],
rules: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
},
close() {
this.$emit('AddChanged')
},
setParentData(parentData) {
if (parentData) {
this.form = parentData
crudDevice.vehileInfo(parentData.vehicle_code).then(data => {
this.dialogVisible = true
this.form2 = data
})
}
}
}
}
</script>
<style scoped>
::v-deep .el-card__header {
padding: 5px 0 5px 10px;
background-color: #f8f8f9;
}
::v-deep .el-card__body {
padding: 10px 0 10px 0;
}
</style>

View File

@@ -0,0 +1,269 @@
<template>
<div class="app-container">
<!--表单组件-->
<!-- 字典列表 -->
<el-card class="box-card">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-suffix=":"
>
<el-form-item label="生产车间">
<el-select
v-model="form.product_area"
placeholder=""
style="width: 200px"
>
<el-option
v-for="item in dict.product_area"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="设备编号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="设备编号">
<rrOperation :permission="permission" />
</el-form-item>
</el-form>
</div>
<crudOperation v-show="false" :permission="permission" />
</div>
<!--表格渲染-->
<el-dialog
:close-on-click-modal="false"
:visible.sync=dialogVisible
title="载具物料信息"
width="540px"
@close="materiValueCancel()"
>
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
<el-form-item label="载具编码" prop="vehicle_code">
<el-input v-model="materialForm.storagevehicle_code" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="物料编码" prop="material_code">
<template slot-scope="scope">
<el-input v-model="materialForm.material_code" clearable style="width: 370px">
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
</el-input>
</template>
</el-form-item>
<el-form-item label="物料规格" prop="material_spec">
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="物料数量" prop="storage_qty">
<el-input v-model="materialForm.storage_qty" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="物料重量" prop="weight">
<el-input v-model="materialForm.weight" clearable style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="materiValueCancel()">取消</el-button>
<el-button type="primary" @click="materiValueSubmit()">确认</el-button>
</div>
</el-dialog>
<!-- <el-dialog-->
<!-- :close-on-click-modal="false"-->
<!-- :before-close="crud.cancelCU"-->
<!-- :visible.sync="crud.status.cu > 0"-->
<!-- :title="crud.status.title"-->
<!-- width="710px"-->
<!-- >-->
<!-- <el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="120px">-->
<!-- <el-form-item label="载具编码">-->
<!-- <el-input v-model="form.vehicle_code" style="width: 200px;" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点位状态">-->
<!-- <el-input v-model="form.point_status" style="width: 200px;" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="锁定状态">-->
<!-- <el-input v-model="form.lock_type" style="width: 200px;" />-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="text" @click="crud.cancelCU">取消</el-button>-->
<!-- <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="point_code" label="点位编码" sortable width="120" show-overflow-tooltip >
<!-- <template slot-scope="scope">-->
<!-- <el-link type="warning" @click="toView(scope.row)">{{ scope.row.point_code }}</el-link>-->
<!-- </template>-->
</el-table-column>
<el-table-column prop="point_name" label="点位名称" width="150" sortable show-overflow-tooltip />
<el-table-column prop="region_name" label="区域名称" min-width="120" show-overflow-tooltip />
<el-table-column prop="point_status" label="点位状态" >
<template slot-scope="scope">
{{ scope.row.point_status == '2' ? '有料' : scope.row.point_status == '3'?'空载具':'空位' }}
</template>
</el-table-column>
<el-table-column prop="lock_type_name" label="锁定类型" />
<el-table-column prop="vehicle_code" label="载具编码" min-width="100">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row.vehicle_code)">{{ scope.row.vehicle_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="material_spec" label="物料规格" />
<el-table-column prop="remark" label="备注" min-width="100" show-overflow-tooltip />
<el-table-column prop="is_used" label="是否启用">
<template slot-scope="scope">
{{ scope.row.is_used == '1' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="update_name" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150" />
<!-- <el-table-column-->
<!-- v-permission="[]"-->
<!-- label="操作"-->
<!-- fixed="right"-->
<!-- width="120px"-->
<!-- align="center"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <udOperation-->
<!-- :data="scope.row"-->
<!-- :permission="permission"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!--分页组件-->
<MaterDtl
:dialog-show.sync="materialShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<pagination />
</el-card>
<ViewDialog ref="viewDialog" />
</div>
</template>
<script>
import crudDevice from '@/views/wms/staging_manage/staging/kzStaging/kzStaging.js'
import CRUD, { presenter, header, form } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import udOperation from '@crud/UD.operation'
import ViewDialog from '@/views/wms/staging_manage/staging/kzStaging/ViewDialog'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import crudStoragevehicleinfo from '@/views/wms/masterdata_manage/master/storagevehicleinfo/storagevehicleinfo'
const defaultForm = { product_area: 'A1', region_code: 'A1_KZHC', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
export default {
name: 'SKdevice',
components: { crudOperation, pagination, udOperation, rrOperation, ViewDialog, MaterDtl },
dicts: ['product_area'],
cruds() {
return [
CRUD({ title: '刻字缓存区', url: 'api/point/queryVehicle', query: { product_area: 'A1', region_code: 'A1_KZHC' }, idField: 'device_code', crudMethod: { ...crudDevice }})
]
},
mixins: [presenter(), header(), form(defaultForm)],
data() {
return {
materialForm:{},
materType:'',
materialShow: false,
dialogVisible: false,
queryTypeOptions: [
{ key: 'name', display_name: '字典名称' },
{ key: 'description', display_name: '描述' }
],
rules: {
material_spec: [
{ required: true, message: '请输入编码', trigger: 'blur' }
]
},
permission: {}
}
},
methods: {
setMaterValue(row) {
this.materialForm.material_id = row.material_id
this.materialForm.material_code = row.material_code
this.materialForm.material_name = row.material_name
this.materialForm.material_spec = row.material_spec
},
mclearable(){
this.materialForm.material_id = ''
this.materialForm.material_code = ''
this.materialForm.material_name = ''
},
materiValueCancel(){
this.materialForm = {}
this.dialogVisible = false
},
materiValueSubmit(){
console.log(this.materialForm)
crudStoragevehicleinfo.updateVehicleMaterial(this.materialForm).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.materiValueCancel()
this.crud.refresh()
}).catch(() => {
})
},
toView(row) {
crudStoragevehicleinfo.vehileInfo(row).then(data => {
this.dialogVisible = true
this.materialForm = data
})
},
toViewOption(row) {
if (row) {
this.$refs.viewDialog.setParentData(row)
}
},
queryMater(index, row) {
this.materialShow = true
this.nowindex = index
this.nowrow = row
},
updateSKMaterial(row) {
crudDevice.edit(row).then(() => {
this.notify('保存成功', 'success')
}).catch(() => {
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,70 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/point',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/point/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/point',
method: 'put',
data
})
}
export function findPoints(area_type) {
return request({
url: 'api/point/area_type/' + area_type
})
}
export function changeActive(data) {
return request({
url: 'api/point/changeActive',
method: 'put',
data
})
}
export function getPoint(data) {
return request({
url: '/api/point/getPoint',
method: 'post',
data
})
}
export function getRegion() {
return request({
url: '/api/point/getRegion',
method: 'get'
})
}
export function changeUsed(data) {
return request({
url: 'api/point/changeUsed',
method: 'post',
data: data
})
}
export function vehileInfo(data) {
return request({
url: 'api/storagevehicleinfo/vehicleInfo?vehicle_code='+data,
method: 'get',
})
}
export default { add, edit, del, changeActive, findPoints, getPoint, getRegion, changeUsed, vehileInfo }

View File

@@ -0,0 +1,156 @@
<template>
<div class="app-container">
<!--表单组件-->
<el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible="crud.status.cu > 0"
:title="crud.status.title"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="物料系列" prop="code">
<el-input v-model="form.material_spec" style="width: 370px;" />
</el-form-item>
<el-form-item label="工序调度编号">
<el-input v-model="form.process_id" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!-- 字典列表 -->
<el-card class="box-card">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="设备编号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation :permission="permission" />
</div>
<crudOperation :permission="permission" />
</div>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="product_area" label="生产车间" width="100px" show-overflow-tooltip />
<el-table-column prop="device_code" label="设备编码" width="100px" show-overflow-tooltip />
<el-table-column prop="material_id" label="物料id" width="200px" show-overflow-tooltip>
<template slot-scope="scope">
<el-input v-model="scope.row.material_id">
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
</el-input>
</template>
</el-table-column>
<el-table-column prop="material_name" label="物料名称" width="200px" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="200px" show-overflow-toolti />
<el-table-column prop="deviceinstor_qty" label="物料数量(个)" align="center" width="120px" show-overflow-tooltip>
<template slot-scope="scope">
<el-input v-model="scope.row.deviceinstor_qty" /></template>
</el-table-column>
<el-table-column prop="deviceinstor_weight" label="物料重量(g)" align="center" width="120px" show-overflow-tooltip>
<template slot-scope="scope">
<el-input v-model="scope.row.deviceinstor_weight" /></template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip />
<el-table-column label="操作" width="150px" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" style="margin-left: -1px;margin-right: 2px" type="text" @click="updateSKMaterial(scope.row)">提交修改</el-button>
</template>
</el-table-column>
</el-table>
<MaterDtl
:dialog-show.sync="materialShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<!--分页组件-->
<pagination />
</el-card>
</div>
</template>
<script>
import crudDevice from '@/views/wms/device_manage/deviceMaterial/deviceMaterial.js'
import CRUD, { presenter, header, form } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import MaterDtl from '@/views/wms/pub/MaterDialog'
const defaultForm = { product_area: 'A1', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
export default {
name: 'SKdevice',
components: { crudOperation, pagination, rrOperation, MaterDtl },
cruds() {
return [
CRUD({ title: '深坑设备物料', url: 'api/specialDevice/query', query: { product_area: 'A1', workprocedure_id: '1535144552481034240' }, idField: 'device_code', crudMethod: { ...crudDevice }})
]
},
mixins: [presenter(), header(), form(defaultForm)],
data() {
return {
materialShow: false,
queryTypeOptions: [
{ key: 'name', display_name: '字典名称' },
{ key: 'description', display_name: '描述' }
],
rules: {
material_spec: [
{ required: true, message: '请输入编码', trigger: 'blur' }
]
},
permission: {
add: ['admin', 'dict:add'],
edit: ['admin', 'dict:edit'],
del: ['admin', 'dict:del']
}
}
},
methods: {
queryMater(index, row) {
this.materialShow = true
this.nowindex = index
this.nowrow = row
},
updateSKMaterial(row) {
crudDevice.edit(row).then(() => {
this.notify('保存成功', 'success')
}).catch(() => {
})
},
setMaterValue(row) {
this.nowrow.material_id = row.material_id
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.nowrow.material_spec = row.material_spec
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
}
}
}
</script>
<style scoped>
</style>