15 changed files with 717 additions and 14 deletions
@ -0,0 +1,230 @@ |
|||||
|
<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.productname" |
||||
|
clearable |
||||
|
size="mini" |
||||
|
placeholder="物料编码" |
||||
|
disabled="false" |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="工单号"> |
||||
|
<el-input |
||||
|
v-model="query.workorder_code" |
||||
|
clearable |
||||
|
size="mini" |
||||
|
placeholder="工单号" |
||||
|
disabled="false" |
||||
|
@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'}" |
||||
|
@selection-change="crud.selectionChangeHandler" |
||||
|
> |
||||
|
<el-table-column type="selection" width="55" /> |
||||
|
<el-table-column prop="point_code" label="所在点位" width="120px" /> |
||||
|
<el-table-column prop="productName" label="物料编码" /> |
||||
|
<el-table-column prop="palletSN" label="子托盘号" min-width="120" show-overflow-tooltip /> |
||||
|
<el-table-column prop="qty" label="数量" width="100" show-overflow-tooltip /> |
||||
|
</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-button |
||||
|
type="primary" |
||||
|
@click="submitSelectedRows"> |
||||
|
原材料出库 |
||||
|
</el-button> |
||||
|
</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 { mount } from 'sortablejs' |
||||
|
|
||||
|
export default { |
||||
|
name: 'WorkOrderDetailDialog', |
||||
|
components: { rrOperation, pagination }, |
||||
|
dicts: ['is_used', 'vehicle_type'], |
||||
|
cruds() { |
||||
|
return CRUD({ title: '点位详情', url: 'api/pointDetail', optShow: {}}) |
||||
|
}, |
||||
|
mixins: [presenter(), header()], |
||||
|
props: { |
||||
|
dialogShow: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
isSingle: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
productname: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
},workorder_code: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dialogVisible: false, |
||||
|
tableRadio: null, |
||||
|
tableData: [] |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
dialogShow: { |
||||
|
handler(newValue) { |
||||
|
this.dialogVisible = newValue |
||||
|
} |
||||
|
}, |
||||
|
productname(newVal) { |
||||
|
// 监听传递的值变化,并在变化时执行赋值操作 |
||||
|
this.query.productname = newVal; |
||||
|
this.executeQuery(); |
||||
|
}, |
||||
|
workorder_code(newVal) { |
||||
|
// 监听传递的值变化,并在变化时执行赋值操作 |
||||
|
this.query.workorder_code=newVal |
||||
|
this.workorder_code = newVal; |
||||
|
} |
||||
|
}, |
||||
|
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('tableChanged', 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('tableChanged', this.rows) |
||||
|
},executeQuery() { |
||||
|
this.crud.toQuery(); |
||||
|
},submitSelectedRows() { |
||||
|
const selectedRows = this.$refs.table.selection; |
||||
|
if (selectedRows.length === 0) { |
||||
|
this.$message.error('请至少选择一行数据'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// 获取选中行的 point_code |
||||
|
const pointCodes = selectedRows.map(row => row.point_code); |
||||
|
|
||||
|
// 弹出输入回温时间和回温模式的对话框 |
||||
|
this.$prompt('请输入回温时间', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
inputPattern: /\d+/, |
||||
|
inputErrorMessage: '回温时间必须为数字' |
||||
|
}).then(({ value: time }) => { |
||||
|
this.$prompt('请输入回温模式(0-普通模式,1-快速模式)', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消' |
||||
|
}).then(({ value: mode }) => { |
||||
|
// 提交数据给后台接口 |
||||
|
this.$axios.post('/api/pointDetail/add', { |
||||
|
pointCodes, |
||||
|
time, |
||||
|
mode, |
||||
|
workorder_code: this.workorder_code // 使用workorder_code属性 |
||||
|
}).then(response => { |
||||
|
// 提交成功处理 |
||||
|
this.$message.success('提交成功!'); |
||||
|
// 关闭当前对话框 |
||||
|
this.dialogVisible = false; |
||||
|
}).catch(error => { |
||||
|
// 提交失败处理 |
||||
|
this.$message.error('提交失败,请重试'); |
||||
|
}); |
||||
|
}).catch(() => { |
||||
|
// 用户点击了取消按钮 |
||||
|
this.$message({ |
||||
|
type: 'info', |
||||
|
message: '已取消提交操作' |
||||
|
}); |
||||
|
}); |
||||
|
}).catch(() => { |
||||
|
// 用户点击了取消按钮 |
||||
|
this.$message({ |
||||
|
type: 'info', |
||||
|
message: '已取消提交操作' |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
<style rel="stylesheet/scss" lang="scss" scoped> |
||||
|
::v-deep .el-dialog__body { |
||||
|
padding-top: 0px; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
|
@ -0,0 +1,327 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<!--工具栏--> |
||||
|
<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-input |
||||
|
v-model="query.somtOrderNo" |
||||
|
clearable |
||||
|
placeholder="出库单号" |
||||
|
class="filter-item" |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="生产工单"> |
||||
|
<el-input |
||||
|
v-model="query.moname" |
||||
|
clearable |
||||
|
placeholder="生产工单" |
||||
|
class="filter-item" |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="托号"> |
||||
|
<el-input |
||||
|
v-model="query.palletSN" |
||||
|
clearable |
||||
|
placeholder="托号" |
||||
|
class="filter-item" |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="物料编码"> |
||||
|
<el-input |
||||
|
v-model="query.productName" |
||||
|
clearable |
||||
|
placeholder="物料编码" |
||||
|
class="filter-item" |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<rrOperation /> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
||||
|
<crudOperation :permission="permission" /> |
||||
|
<!--表单组件--> |
||||
|
<el-dialog |
||||
|
:close-on-click-modal="false" |
||||
|
:before-close="crud.cancelCU" |
||||
|
:visible.sync="crud.status.cu > 0" |
||||
|
:title="crud.status.title" |
||||
|
width="820px" |
||||
|
> |
||||
|
<el-form |
||||
|
ref="form" |
||||
|
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" |
||||
|
:inline="true" |
||||
|
:model="form" |
||||
|
:rules="rules" |
||||
|
size="mini" |
||||
|
label-width="135px" |
||||
|
label-suffix=":" |
||||
|
> |
||||
|
<el-form-item label="出库单号" > |
||||
|
<el-input v-model="form.somtOrderNo" style="width: 240px;" @focus="getMaterial" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="生产工单"> |
||||
|
<el-input v-model="form.moname" style="width: 240px;" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="托号"> |
||||
|
<el-input v-model="form.palletSN" style="width: 240px;" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="晶棒号" > |
||||
|
<el-input v-model="form.lotSN" style="width: 240px;" @focus="getMaterial" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="物料编码"> |
||||
|
<el-input v-model="form.productName" style="width: 240px;" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="物料描述"> |
||||
|
<el-input v-model="form.productDescription" style="width: 240px;" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户编码"> |
||||
|
<el-input v-model="form.supplierCode" style="width: 240px;" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户名称"> |
||||
|
<el-input v-model="form.supplierName" style="width: 240px;" /> |
||||
|
</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 prop="somtOrderNo" label="出库单号" :min-width="flexWidth('somtOrderNo',crud.data,'出库单号')" /> |
||||
|
<el-table-column prop="moname" label="生产工单" :min-width="flexWidth('moname',crud.data,'生产工单')" /> |
||||
|
<el-table-column prop="palletSN" label="托号" :min-width="flexWidth('palletSN',crud.data,'托号')" /> |
||||
|
<el-table-column prop="lotSN" label="晶棒号" :min-width="flexWidth('lotSN',crud.data,'晶棒号')" /> |
||||
|
<el-table-column prop="productName" label="物料编码" :min-width="flexWidth('productName',crud.data,'物料编码')" /> |
||||
|
<el-table-column prop="productDescription" label="物料描述" :min-width="flexWidth('productDescription',crud.data,'物料描述')" /> |
||||
|
<el-table-column prop="supplierCode" label="客户编码" :min-width="flexWidth('supplierCode',crud.data,'客户编码')" /> |
||||
|
<el-table-column prop="supplierName" label="客户名称" :min-width="flexWidth('supplierName',crud.data,'客户名称')" /> |
||||
|
<!-- <el-table-column prop="status" label="入库类型" :min-width="flexWidth('status',crud.data,'入库类型')"> |
||||
|
<template slot-scope="scope"> |
||||
|
{{ scope.row.status=="0"?'未出库':'已出库' }} |
||||
|
</template> |
||||
|
</el-table-column> --> |
||||
|
<el-table-column prop="createTime" label="创建日期" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
type="text" |
||||
|
icon="el-icon-add" |
||||
|
:disabled="scope.row.status=='1'" |
||||
|
@click="doOperate(scope.row)" |
||||
|
>工单出库</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<!--分页组件--> |
||||
|
<pagination /> |
||||
|
</div> |
||||
|
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" /> |
||||
|
<PointDetailDialog :dialog-show.sync="pointDetailDialog" :workorder_code="workorder_code" :productname="productname" @tableChanged="tableChanged" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import crudPdmBdWorkorder from './workorder' |
||||
|
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion' |
||||
|
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint' |
||||
|
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 crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop' |
||||
|
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue' |
||||
|
import PointDetailDialog from '@/views/wms/pdm/workerordertwo/PointDetailDialog.vue' |
||||
|
import item from '@/layout/components/Sidebar/Item.vue' |
||||
|
|
||||
|
const defaultForm = { |
||||
|
workorder_id: null, |
||||
|
workorder_code: null, |
||||
|
plan_qty: null, |
||||
|
real_qty: null, |
||||
|
material_id: null, |
||||
|
vehicle_type: null, |
||||
|
planproducestart_date: null, |
||||
|
planproduceend_date: null, |
||||
|
realproducestart_date: null, |
||||
|
realproduceend_date: null, |
||||
|
material_spec: null, |
||||
|
material_code: null, |
||||
|
material_name: null, |
||||
|
standing_time: null, |
||||
|
point_code: null, |
||||
|
point_name: null, |
||||
|
region_code: null, |
||||
|
region_name: null, |
||||
|
workorder_status: null, |
||||
|
is_needmove: true, |
||||
|
workorder_type: null, |
||||
|
passback_status: null, |
||||
|
workshop_code: null, |
||||
|
ext_id: null, |
||||
|
is_delete: false, |
||||
|
is_urgent: false |
||||
|
} |
||||
|
export default { |
||||
|
name: 'workorder', |
||||
|
dicts: ['vehicle_type', 'pdm_workorder_status'], |
||||
|
components: { PointDetailDialog,MaterialDialog, pagination, crudOperation, rrOperation, udOperation }, |
||||
|
mixins: [presenter(), header(), form(defaultForm), crud()], |
||||
|
cruds() { |
||||
|
return CRUD({ |
||||
|
title: '晶棒工单管理', |
||||
|
url: 'api/workorder', |
||||
|
idField: 'workorder_id', |
||||
|
sort: 'workorder_id,desc', |
||||
|
crudMethod: { ...crudPdmBdWorkorder }, |
||||
|
optShow: { |
||||
|
add: false, |
||||
|
edit: false, |
||||
|
del: false, |
||||
|
download: false, |
||||
|
reset: false |
||||
|
}, |
||||
|
}) |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
permission: {}, |
||||
|
rules: { |
||||
|
material_code: [ |
||||
|
{ required: true, message: '物料不能为空', trigger: 'blur' } |
||||
|
], |
||||
|
plan_qty: [ |
||||
|
{ required: true, message: '计划数量不能为空', trigger: 'blur' } |
||||
|
], |
||||
|
planproducestart_date: [ |
||||
|
{ required: true, message: '计划开始不能为空', trigger: 'change' } |
||||
|
], |
||||
|
planproduceend_date: [ |
||||
|
{ required: true, message: '计划结束不能为空', trigger: 'change' } |
||||
|
], |
||||
|
point_code: [ |
||||
|
{ required: true, message: '设备编码不能为空', trigger: 'change' } |
||||
|
], |
||||
|
region_code: [ |
||||
|
{ required: true, message: '区域编码不能为空', trigger: 'change' } |
||||
|
] |
||||
|
/* workorder_type: [ |
||||
|
{ required: true, message: '工单类型不能为空', trigger: 'blur' } |
||||
|
]*/ |
||||
|
}, |
||||
|
queryTypeOptions: [ |
||||
|
{ key: 'workorder_code', display_name: '工单编号' }, |
||||
|
{ key: 'point_code', display_name: '设备编码' } |
||||
|
], |
||||
|
workShopList: [], |
||||
|
regionList: [], |
||||
|
pointList: [], |
||||
|
regionCodeParam: null, |
||||
|
materialDialog: false, |
||||
|
pointDetailDialog:false, |
||||
|
message: null |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getWorkShopList() |
||||
|
this.getRegionList() |
||||
|
}, |
||||
|
methods: { |
||||
|
item() { |
||||
|
return item |
||||
|
}, |
||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
||||
|
[CRUD.HOOK.beforeRefresh]() { |
||||
|
return true |
||||
|
}, |
||||
|
getWorkShopList() { // 获取车间列表 |
||||
|
crudMdBaseWorkShop.getWorkShopList().then(res => { |
||||
|
this.workShopList = res |
||||
|
}) |
||||
|
}, |
||||
|
getRegionList() { // 获取区域列表 |
||||
|
const param = { |
||||
|
is_has_workder: true |
||||
|
} |
||||
|
crudSchBaseRegion.getRegionList(param).then(res => { |
||||
|
this.regionList = res |
||||
|
}) |
||||
|
}, |
||||
|
getPointList() { // 获取点位列表 |
||||
|
if (this.regionCodeParam) { |
||||
|
const param = { |
||||
|
region_code: this.regionCodeParam |
||||
|
} |
||||
|
crudSchBasePoint.getPointList(param).then(res => { |
||||
|
this.pointList = res |
||||
|
this.regionCodeParam = null |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
getMaterial() { |
||||
|
this.materialDialog = true |
||||
|
}, |
||||
|
tableChanged(row) { |
||||
|
this.form.material_name = row.material_name |
||||
|
this.form.material_id = row.material_id |
||||
|
this.form.material_spec = row.material_spec |
||||
|
this.form.material_code = row.material_code |
||||
|
}, |
||||
|
setRegionName(data) { |
||||
|
// 清空 |
||||
|
this.form.point_code = null |
||||
|
this.form.point_name = null |
||||
|
this.regionCodeParam = data |
||||
|
var region = this.regionList.find(item => item.region_code === data) |
||||
|
this.form.region_name = region.region_name |
||||
|
this.getPointList() |
||||
|
}, |
||||
|
setPointName(data) { |
||||
|
var point = this.pointList.find(item => item.point_code === data) |
||||
|
this.form.point_name = point.point_name |
||||
|
}, |
||||
|
handOrderStatus(value) { |
||||
|
this.crud.query.more_order_status = null |
||||
|
if (value) { |
||||
|
this.crud.query.more_order_status = value.toString() |
||||
|
} |
||||
|
this.crud.toQuery() |
||||
|
}, |
||||
|
doOperate(row) { |
||||
|
this.workorder_code=row.moname |
||||
|
this.productname=row.productName |
||||
|
this.pointDetailDialog = true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,27 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
export function add(data) { |
||||
|
return request({ |
||||
|
url: 'api/workorder', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function del(ids) { |
||||
|
return request({ |
||||
|
url: 'api/workorder/', |
||||
|
method: 'delete', |
||||
|
data: ids |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function edit(data) { |
||||
|
return request({ |
||||
|
url: 'api/workorder', |
||||
|
method: 'put', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { add, edit, del } |
Loading…
Reference in new issue