点位代码更新

This commit is contained in:
lyd
2022-11-04 14:29:21 +08:00
parent 1900d7cd96
commit 19db98e95b
7 changed files with 421 additions and 28 deletions

View File

@@ -0,0 +1,155 @@
<template>
<el-dialog
title="生产任务选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="物料名称">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="物料名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" width="160" />
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="140" />
<el-table-column prop="material_model" label="物料型号" />
<el-table-column prop="class_name" label="物料分类" width="140" />
<el-table-column prop="unit_name" label="计量单位" />
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
<el-table-column prop="product_series_name" label="系列" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="135" />
</el-table>
<!--分页组件-->
<pagination />
<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, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'MaterialDialog',
components: { rrOperation, pagination },
dicts: ['is_used'],
cruds() {
return CRUD({ title: '生产任务', url: 'api/Materialbase', optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,158 @@
<template>
<el-dialog
title="生产任务选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="物料名称">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="物料名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="workorder_code" label="工单编号" width="120px"/>
<el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="device_name" label="设备" width="100" show-overflow-tooltip />
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
<el-table-column prop="vehicle_type" label="载具类型" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template>
</el-table-column>
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150" />
</el-table>
<!--分页组件-->
<pagination />
<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, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'WorkOrderDialog',
components: { rrOperation, pagination },
dicts: ['is_used', 'vehicle_type'],
cruds() {
return CRUD({ title: '生产工单', url: 'api/workorder', optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged4', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged4', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -225,7 +225,7 @@
<el-form-item label="点位名称" prop="point_name">
<el-input v-model="form.point_name" style="width: 370px;" />
</el-form-item>
<el-form-item label="点位状态" prop="point_status">
<el-form-item label="点位状态" prop="point_status" v-show="pointStatusDialogList.length > 0">
<el-select
v-model="form.point_status"
size="mini"
@@ -256,7 +256,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="点位类型" prop="device_point_type">
<el-form-item label="点位类型" prop="device_point_type" v-show="pointTypesDialogList.length > 0">
<el-select
v-model="form.point_type"
size="mini"
@@ -271,10 +271,24 @@
/>
</el-select>
</el-form-item>
<el-form-item label="载具编码" prop="vehicle_code">
<el-form-item label="载具编码" prop="vehicle_code" v-if="form.point_status !== '1'">
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="库存数" prop="ivt_qty" v-if="form.point_status === '3'">
<el-input-number v-model="form.ivt_qty" :min="1" :precision="3" :max="999" label="库存数" size="mini"/>
</el-form-item>
<el-form-item label="物料来源" v-if="form.point_status === '3'">
<el-radio-group v-model="choose" size="mini">
<el-radio-button label="物料"></el-radio-button>
<el-radio-button label="工单"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="物料名称" prop="vehicle_code" v-if="false">
<el-input v-model="form.material_id" clearable style="width: 370px;" @focus="getMaterial"/>
</el-form-item>
<el-form-item label="物料名称" prop="vehicle_code" v-if="form.point_status === '3'">
<el-input v-model="form.material_name" clearable style="width: 370px;" @focus="getMaterial"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" />
</el-form-item>
@@ -337,7 +351,8 @@
<!--分页组件-->
<pagination />
</div>
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged3="tableChanged"/>
<WorkOrderDialog :dialog-show.sync="workOrderDialog" @tableChanged4="tableChanged"/>
<ViewDialog ref="viewDialog" />
</div>
</template>
@@ -351,6 +366,8 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import ViewDialog from '@/views/wms/sch/point/ViewDialog'
import MaterialDialog from '@/views/wms/sch/point/MaterialDialog'
import WorkOrderDialog from '@/views/wms/sch/point/WorkOrderDialog'
const defaultForm = {
point_id: null,
@@ -374,7 +391,7 @@ const defaultForm = {
export default {
name: 'Point',
dicts: ['vehicle_type', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'vehicle_type'],
components: { pagination, crudOperation, rrOperation, udOperation , ViewDialog},
components: { WorkOrderDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation , ViewDialog},
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -395,6 +412,9 @@ export default {
data() {
return {
syncLoading: false,
materialDialog: false,
workOrderDialog: false,
choose: '物料',
invtypelist: [],
pointStatusList: [],
pointStatusDialogList: [],
@@ -513,8 +533,18 @@ export default {
if (row) {
this.$refs.viewDialog.setParentData(row)
}
},
getMaterial() {
if (this.choose == '物料') {
this.materialDialog = true
} else {
this.workOrderDialog = true
}
},
tableChanged(row) {
this.form.material_name = row.material_name
this.form.material_id = row.material_id
}
}
}
</script>