更改生产任务表单,添加托盘类型,修改涉及托盘类型的代码。
This commit is contained in:
155
wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue
Normal file
155
wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue
Normal 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="物料编码" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="规格" show-overflow-tooltip />
|
||||
<el-table-column prop="material_model" label="型号" />
|
||||
<el-table-column prop="english_name" label="外文名称" />
|
||||
</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'
|
||||
import crudWorkprocedureios from '@/api/wms/st/in/workprocedureios'
|
||||
|
||||
export default {
|
||||
name: 'MaterDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '物料', url: 'api/workprocedureiosIn/getMaterial', crudMethod: { ...crudWorkprocedureios }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
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>
|
||||
|
||||
@@ -128,15 +128,9 @@
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="780px">
|
||||
<el-form ref="form" inline :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form-item label="物料名称" prop="material_id">
|
||||
<el-select v-model="form.material_id" filterable clearable style="width: 200px;" placeholder="请选择物料">
|
||||
<el-option
|
||||
v-for="item in materialList"
|
||||
:key="item.material_id"
|
||||
:label="item.material_name"
|
||||
:value="item.material_id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<label slot="label">物 料</label>
|
||||
<el-input v-model="form.material_name" style="width: 200px;" @focus="getMater" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="device_id">
|
||||
<el-select v-model="form.device_id" filterable clearable style="width: 200px" placeholder="请选择设备">
|
||||
@@ -148,7 +142,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产线名称" prop="produceline_id">
|
||||
<el-form-item v-if="false" label="产线名称" prop="produceline_id">
|
||||
<el-select v-model="form.produceline_id" filterable clearable class="filter-item" style="width: 200px" placeholder="请选择产线">
|
||||
<el-option
|
||||
v-for="item in producelineList"
|
||||
@@ -254,7 +248,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="device_name" label="设备名称" width="120" />
|
||||
<el-table-column prop="produceline_name" label="产线名称" />
|
||||
<el-table-column v-if="false" prop="produceline_name" label="产线名称" />
|
||||
<el-table-column prop="cust_name" label="客户名称" />
|
||||
<el-table-column prop="seq_no" label="生产顺序" />
|
||||
<el-table-column prop="plan_qty" label="计划生产数量" width="120" />
|
||||
@@ -298,6 +292,7 @@
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3" />
|
||||
<CopyDialog ref="copyChiled" :open-param="openParam" :dialog-show.sync="copyShow" @tableChanged2="tableChanged2" />
|
||||
<SortDialog :open-param="openParam" :dialog-show.sync="sortShow" @tableChanged1="tableChanged1" />
|
||||
<MaterDialog :dialog-show.sync="materDialog" :dialog-matertype="materType" @tableChanged4="tableChanged4" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -311,12 +306,13 @@ import pagination from '@crud/Pagination'
|
||||
import UploadDialog from '@/views/wms/pdm/produceTask/UploadDialog'
|
||||
import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog'
|
||||
import SortDialog from '@/views/wms/pdm/produceTask/SortDialog'
|
||||
import MaterDialog from './MaterDialog.vue'
|
||||
|
||||
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null }
|
||||
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, is_package: '0' }
|
||||
export default {
|
||||
name: 'Producetask',
|
||||
dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog, CopyDialog, SortDialog },
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog, CopyDialog, SortDialog, MaterDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '生产任务', url: 'api/producetask', idField: 'producetask_id', sort: 'producetask_id,desc', optShow: { add: true, edit: false, del: false, download: false, reset: true }, crudMethod: { ...crudProducetask }})
|
||||
@@ -340,16 +336,15 @@ export default {
|
||||
sort_update: false,
|
||||
openParam: {},
|
||||
currentRow: null,
|
||||
materDialog: false,
|
||||
materType: '',
|
||||
rules: {
|
||||
material_id: [
|
||||
{ required: true, message: '物料标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_id: [
|
||||
{ required: true, message: '设备标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
produceline_id: [
|
||||
{ required: true, message: '产线标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
// produceline_id: [
|
||||
// { required: true, message: '产线标识不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
seq_no: [
|
||||
{ required: true, message: '生产顺序不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -364,6 +359,9 @@ export default {
|
||||
],
|
||||
stand_hour: [
|
||||
{ required: true, message: '静置时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_name: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
@@ -499,6 +497,14 @@ export default {
|
||||
},
|
||||
tableChanged1() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getMater() {
|
||||
this.materDialog = true
|
||||
},
|
||||
tableChanged4(row) {
|
||||
console.log(row)
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_name = row.material_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user