18 changed files with 583 additions and 858 deletions
@ -0,0 +1,67 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function add(data) { |
|||
return request({ |
|||
url: 'api/report', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function del(ids) { |
|||
return request({ |
|||
url: 'api/report/', |
|||
method: 'delete', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/report', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function getGroup(data) { |
|||
return request({ |
|||
url: 'api/report/getGroup', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function getSupplierNameList(data) { |
|||
return request({ |
|||
url: 'api/report/getSupplierNameList', |
|||
method: 'get', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function getProductDescriptionList(data) { |
|||
return request({ |
|||
url: 'api/report/getProductDescriptionList', |
|||
method: 'get', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function getLotSNList(data) { |
|||
return request({ |
|||
url: 'api/report/getLotSNList', |
|||
method: 'get', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function getIngotBatchList(data) { |
|||
return request({ |
|||
url: 'api/report/getIngotBatchList', |
|||
method: 'get', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export default { add, edit, del, getGroup, getSupplierNameList, getProductDescriptionList, getLotSNList, getIngotBatchList } |
@ -0,0 +1,256 @@ |
|||
<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-select |
|||
v-model="query.point_code" |
|||
clearable |
|||
size="mini" |
|||
placeholder="点位编码" |
|||
class="filter-item" |
|||
filterable |
|||
@remote-method="getPointList" |
|||
> |
|||
<el-option |
|||
v-for="item in pointList" |
|||
:label="item.point_code" |
|||
:value="item.point_code" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<rrOperation /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission"> |
|||
<el-button |
|||
slot="right" |
|||
class="filter-item" |
|||
type="success" |
|||
:disabled="confirm_flag" |
|||
icon="el-icon-check" |
|||
size="mini" |
|||
@click="confirm" |
|||
> |
|||
提交移库 |
|||
</el-button> |
|||
<el-button |
|||
slot="right" |
|||
class="filter-item" |
|||
type="primary" |
|||
icon="el-icon-s-promotion" |
|||
size="mini" |
|||
@click="autoMove" |
|||
> |
|||
一键移库 |
|||
</el-button> |
|||
</crudOperation> |
|||
<el-dialog |
|||
title="确认" |
|||
:visible.sync="dialogVisible" |
|||
width="30%" |
|||
> |
|||
<span>您确定要移库吗?</span> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogVisible = false">取消</el-button> |
|||
<el-button type="primary" @click="confirmMove">确定</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="table" |
|||
v-loading="crud.loading" |
|||
:data="crud.data" |
|||
size="mini" |
|||
:cell-style="cellStyle" |
|||
style="width: 100%;" |
|||
height="550" |
|||
@selection-change="handleSelectionChange" |
|||
> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="pointCode" label="点位名称" :min-width="flexWidth('pointCode',crud.data,'点位名称')" /> |
|||
<el-table-column prop="regionName" label="区域名称" :min-width="flexWidth('regionName',crud.data,'区域名称')" /> |
|||
<el-table-column prop="subTray" label="子托编码" :min-width="flexWidth('subTray',crud.data,'子托编码')" /> |
|||
<el-table-column prop="motherTray" label="母托编码" :min-width="flexWidth('motherTray',crud.data,'母托编码')" /> |
|||
<el-table-column prop="status" label="提交状态" :formatter="format_work_order_two_status" :min-width="flexWidth('status',crud.data,'工单状态')" /> |
|||
<el-table-column prop="updateTime" label="入库时间" :min-width="flexWidth('updateTime',crud.data,'入库时间')" /> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CRUD, { crud, 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 crudSchBasePoint from '@/views/wms/sch/point/schBasePoint' |
|||
|
|||
export default { |
|||
name: 'moveStor2', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
mixins: [presenter(), header(), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '回温区移库快速回温区', |
|||
url: 'api/report/yl/movedetail2', |
|||
idField: 'pointCode', |
|||
sort: 'pointCode,desc', |
|||
optShow: { |
|||
add: false, |
|||
edit: false, |
|||
del: false, |
|||
download: false, |
|||
reset: false |
|||
}, |
|||
query: {status:'0'} |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
permission: { |
|||
}, |
|||
confirm_flag: false, |
|||
dialogVisible: false, |
|||
rows: [], |
|||
pointList: [], |
|||
choose: '物料' |
|||
} |
|||
}, |
|||
created() { |
|||
this.getPointList() |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
this.handleCurrentChange(null) |
|||
return true |
|||
}, |
|||
confirm() { |
|||
this.rows = this.$refs.table.selection |
|||
if (this.rows.length <= 0) { |
|||
this.$message('请先勾选托盘!') |
|||
return |
|||
} |
|||
// 获取选中行的托盘号 subTray |
|||
const pointCodes = this.rows.map(row => row.pointCode) |
|||
// 弹出输入回温时间和回温模式的对话框 |
|||
this.$prompt('请输入回温时间(小时)', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
inputPattern: /\d+/, |
|||
inputErrorMessage: '回温时间(小时)必须为数字' |
|||
}).then(({ value: time }) => { |
|||
// 提交数据给后台接口 |
|||
this.$axios.post('/api/workorder/batchCreate2', { |
|||
pointCodes: pointCodes, |
|||
time: time, |
|||
status: '1' |
|||
}).then(response => { |
|||
// 提交成功处理 |
|||
this.$message.success('移库提交成功!') |
|||
this.crud.toQuery() |
|||
}).catch(error => { |
|||
// 提交失败处理 |
|||
this.$message.error('移库提交失败,请重试') |
|||
}) |
|||
}).catch(() => { |
|||
// 用户点击了取消按钮 |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消移库操作' |
|||
}) |
|||
}) |
|||
}, |
|||
autoMove(){ |
|||
this.dialogVisible = true |
|||
}, |
|||
confirmMove(){///api/schBaseTask/move |
|||
// 弹出输入回温时间和回温模式的对话框 |
|||
this.$prompt('请输入回温时间(小时)', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
inputPattern: /\d+/, |
|||
inputErrorMessage: '回温时间(小时)必须为数字' |
|||
}).then(({ value: time }) => { |
|||
// 提交数据给后台接口 |
|||
this.$axios.post('/api/schBaseTask/move2', { |
|||
time: time |
|||
}).then(response => { |
|||
// 提交成功处理 |
|||
this.$message.success('一键移库提交成功!') |
|||
this.crud.toQuery() |
|||
}).catch(error => { |
|||
// 提交失败处理 |
|||
this.$message.error('一键移库提交失败,请重试') |
|||
}) .finally(() => { |
|||
this.dialogVisible = false // Close the dialog |
|||
}) |
|||
}).catch(() => { |
|||
this.dialogVisible = false // Close the dialog |
|||
// 用户点击了取消按钮 |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消一键移库操作' |
|||
}) |
|||
}) |
|||
}, |
|||
handleSelectionChange(val, row) { |
|||
this.rows = this.$refs.table.selection |
|||
var strs = '' |
|||
this.handleCurrentChange(null) |
|||
if (this.rows.length > 0) { |
|||
this.rows.forEach(now => { |
|||
strs += now.status |
|||
}) |
|||
if (strs.indexOf('1') != -1) { |
|||
this.confirm_flag = true |
|||
} |
|||
} |
|||
}, |
|||
handleCurrentChange(current) { |
|||
if (current === null) { |
|||
this.confirm_flag = false |
|||
} |
|||
}, |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
const status = row.status |
|||
|
|||
if (column.property === 'status') { |
|||
if (status == '1') { |
|||
return 'background: #13ce66' |
|||
} else { |
|||
return 'background: #FFBA00' |
|||
} |
|||
} |
|||
}, |
|||
format_work_order_two_status(row, column) { |
|||
if(row.status ==='1'){ |
|||
return '已提交'; |
|||
} |
|||
return '未提交'; |
|||
}, |
|||
getPointList() { // 获取点位列表 |
|||
crudSchBasePoint.getPointsByRegionCodes('HW').then(res => { |
|||
this.pointList = res |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,181 +0,0 @@ |
|||
<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="true" |
|||
@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 /> |
|||
<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' |
|||
|
|||
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 |
|||
}, |
|||
productname: { |
|||
type: String, |
|||
default: '' |
|||
}, workorderCode: { |
|||
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.workorder_code = newVal |
|||
} |
|||
}, |
|||
methods: { |
|||
open() { |
|||
}, |
|||
close() { |
|||
this.crud.resetQuery(false) |
|||
this.$emit('update:dialogShow', false) |
|||
}, |
|||
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> |
|||
|
@ -1,138 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<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.workorder_code" |
|||
clearable |
|||
size="mini" |
|||
placeholder="工单编号" |
|||
:disabled="true" |
|||
@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 prop="workorder_code" label="工单编号" width="120px" /> |
|||
<el-table-column prop="matnr" label="物料编码" /> |
|||
<el-table-column prop="maktx" label="物料名称" min-width="120" show-overflow-tooltip /> |
|||
<el-table-column prop="mtype" label="产品类别" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="mtytxt" label="产品类别描述" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="bdmng" label="数量" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="meins" label="计量单位" width="100" show-overflow-tooltip /> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
type="text" |
|||
icon="el-icon-add" |
|||
@click="doOperate(scope.row)" |
|||
>原材料出库</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</el-dialog> |
|||
<PointDetailDialog :dialog-show.sync="pointDetailDialog" :workorder_code="workorder_code" :productname="productname" /> |
|||
</div> |
|||
</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 PointDetailDialog from '@/views/wms/pdm/workerorder/PointDetailDialog.vue' |
|||
|
|||
export default { |
|||
name: 'WorkOrderDetailDialog', |
|||
components: { PointDetailDialog, rrOperation, pagination }, |
|||
dicts: ['is_used', 'vehicle_type'], |
|||
cruds() { |
|||
return CRUD({ title: '生产工单', url: 'api/pdmBdWorkorderDetail', optShow: {}}) |
|||
}, |
|||
mixins: [presenter(), header()], |
|||
props: { |
|||
dialogShow: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
message: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
pointDetailDialog: false, |
|||
productname: null, |
|||
workorder_code: null |
|||
} |
|||
}, |
|||
watch: { |
|||
dialogShow: { |
|||
handler(newValue) { |
|||
this.dialogVisible = newValue |
|||
} |
|||
}, |
|||
message(newVal) { |
|||
// 监听传递的值变化,并在变化时执行赋值操作 |
|||
this.query.workorder_code = newVal |
|||
this.executeQuery() |
|||
} |
|||
}, |
|||
methods: { |
|||
open() { |
|||
|
|||
}, |
|||
close() { |
|||
this.crud.resetQuery(false) |
|||
this.$emit('update:dialogShow', false) |
|||
}, |
|||
executeQuery() { |
|||
this.crud.toQuery() |
|||
}, |
|||
doOperate(row) { |
|||
this.productname = row.matnr |
|||
this.workorder_code = row.workorder_code |
|||
this.pointDetailDialog = true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
::v-deep .el-dialog__body { |
|||
padding-top: 0px; |
|||
} |
|||
</style> |
|||
|
@ -1,509 +0,0 @@ |
|||
<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="80px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="工单编号"> |
|||
<el-input |
|||
v-model="query.workorder_code" |
|||
clearable |
|||
placeholder="工单编号" |
|||
class="filter-item" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="设备编码"> |
|||
<el-input |
|||
v-model="query.point_code" |
|||
clearable |
|||
placeholder="设备编码" |
|||
class="filter-item" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间"> |
|||
<el-date-picker |
|||
v-model="query.createTime" |
|||
type="datetimerange" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="结束日期" |
|||
@change="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="工单状态"> |
|||
<el-select |
|||
v-model="query.workorder_status" |
|||
multiple |
|||
placeholder="工单状态" |
|||
class="filter-item" |
|||
clearable |
|||
@change="handOrderStatus" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.pdm_workorder_status" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<rrOperation :crud="crud" /> |
|||
</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 v-if="false" label="所属车间"> |
|||
<el-select |
|||
v-model="form.workshop_code" |
|||
placeholder="请选择" |
|||
style="width: 240px;" |
|||
> |
|||
<el-option |
|||
v-for="item in workShopList" |
|||
:label="item.workshop_name" |
|||
:value="item.workshop_code" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="物料名称" prop="material_name"> |
|||
<el-input v-model="form.material_name" style="width: 240px;" @focus="getMaterial" /> |
|||
</el-form-item> |
|||
<el-form-item label="物料编码"> |
|||
<el-input v-model="form.material_id" style="width: 240px;" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="物料规格"> |
|||
<el-input v-model="form.material_spec" style="width: 240px;" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="计划数量" prop="plan_qty"> |
|||
<el-input-number |
|||
v-model.number="form.plan_qty" |
|||
:min="0" |
|||
style="width: 240px;" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="计划开始时间" prop="planproducestart_date"> |
|||
<el-date-picker |
|||
v-model="form.planproducestart_date" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
type="datetime" |
|||
style="width: 240px;" |
|||
placeholder="选择日期时间" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="计划结束时间" prop="planproduceend_date"> |
|||
<el-date-picker |
|||
v-model="form.planproduceend_date" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
type="datetime" |
|||
style="width: 240px;" |
|||
placeholder="选择日期时间" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item v-if="crud.status.edit" label="实际开始时间"> |
|||
<el-date-picker |
|||
v-model="form.realproducestart_date" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
type="datetime" |
|||
style="width: 240px;" |
|||
placeholder="选择日期时间" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item v-if="crud.status.edit" label="实际结束时间"> |
|||
<el-date-picker |
|||
v-model="form.realproduceend_date" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
type="datetime" |
|||
style="width: 240px;" |
|||
placeholder="选择日期时间" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="所属工序" prop="region_code"> |
|||
<el-select |
|||
v-model="form.region_code" |
|||
filterable |
|||
placeholder="请选择" |
|||
style="width: 240px;" |
|||
@change="setRegionName" |
|||
> |
|||
<el-option |
|||
v-for="item in regionList" |
|||
:key="item.region_code" |
|||
:label="item.region_code" |
|||
:value="item.region_code" |
|||
> |
|||
<span style="float: left">{{ item.region_name }}</span> |
|||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.region_code }}</span> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="工序名称"> |
|||
<el-input v-model="form.region_name" style="width: 240px;" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="设备编码" prop="point_code"> |
|||
<el-select |
|||
v-model="form.point_code" |
|||
filterable |
|||
placeholder="请选择" |
|||
style="width: 240px;" |
|||
@change="setPointName" |
|||
> |
|||
<el-option |
|||
v-for="item in pointList" |
|||
:key="item.point_code" |
|||
:label="item.point_code" |
|||
:value="item.point_code" |
|||
> |
|||
<span style="float: left">{{ item.point_name }}</span> |
|||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.point_code }}</span> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="设备名称"> |
|||
<el-input v-model="form.point_name" style="width: 240px;" disabled /> |
|||
</el-form-item> |
|||
<el-form-item label="回温时间(小时)" prop="standing_time"> |
|||
<el-input-number |
|||
v-model.number="form.standing_time" |
|||
:min="0" |
|||
:max="999" |
|||
style="width: 240px;" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item v-if="crud.status.edit" label="实际数量" prop="real_qty"> |
|||
<el-input-number |
|||
v-model.number="form.real_qty" |
|||
:min="0" |
|||
style="width: 240px;" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="载具类型"> |
|||
<el-select |
|||
v-model="form.vehicle_type" |
|||
clearable |
|||
size="mini" |
|||
placeholder="请选择" |
|||
class="filter-item" |
|||
style="width: 240px;" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.vehicle_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item v-if="false" label="工单类型" prop="workorder_type"> |
|||
<el-input v-model="form.workorder_type" style="width: 240px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="是否自动搬运" prop="is_needmove"> |
|||
<el-radio-group v-model="form.is_needmove" style="width: 240px"> |
|||
<el-radio :label="true">是</el-radio> |
|||
<el-radio :label="false">否</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="是否加急" prop="is_needmove"> |
|||
<el-radio-group v-model="form.is_urgent" style="width: 240px"> |
|||
<el-radio :label="true">是</el-radio> |
|||
<el-radio :label="false">否</el-radio> |
|||
</el-radio-group> |
|||
</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="workorder_code" label="工单编号" :min-width="flexWidth('workorder_code',crud.data,'工单编号')" /> |
|||
<el-table-column |
|||
prop="workorder_status" |
|||
label="工单状态" |
|||
:min-width="flexWidth('workorder_status',crud.data,'工单状态')" |
|||
> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.pdm_workorder_status[scope.row.workorder_status] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')" /> |
|||
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" /> |
|||
<!-- <el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />--> |
|||
<!-- <el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" /> |
|||
<el-table-column prop="point_code" label="设备编码" :min-width="flexWidth('point_code',crud.data,'设备编码')" /> |
|||
<el-table-column prop="point_name" label="设备名称" :min-width="flexWidth('point_name',crud.data,'设备名称')" /> --> |
|||
<!-- <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_name',crud.data,'物料标识')" /> |
|||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料标识')" /> |
|||
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_name',crud.data,'物料标识')" /> --> |
|||
<!-- <el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"> --> |
|||
<!-- <template slot-scope="scope"> |
|||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }} |
|||
</template> |
|||
</el-table-column> --> |
|||
<el-table-column |
|||
prop="planproducestart_date" |
|||
label="计划开始时间" |
|||
:min-width="flexWidth('planproducestart_date',crud.data,'计划开始时间')" |
|||
/> |
|||
<el-table-column |
|||
prop="planproduceend_date" |
|||
label="计划结束时间" |
|||
:min-width="flexWidth('planproduceend_date',crud.data,'计划结束时间')" |
|||
/> |
|||
<el-table-column |
|||
prop="realproducestart_date" |
|||
label="实际开始时间" |
|||
:min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')" |
|||
/> |
|||
<el-table-column |
|||
prop="realproduceend_date" |
|||
label="实际结束时间" |
|||
:min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')" |
|||
/> |
|||
<!-- <el-table-column |
|||
prop="standing_time" |
|||
label="回温时间(小时)" |
|||
:min-width="flexWidth('standing_time',crud.data,'回温时间(小时)')" |
|||
/> --> |
|||
<!-- <el-table-column prop="is_needmove" label="是否自动搬运" :min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')"> |
|||
<template slot-scope="scope"> |
|||
{{ scope.row.is_needmove ? '是' : '否' }} |
|||
</template> |
|||
</el-table-column> --> |
|||
<!-- <el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')"> |
|||
<template slot-scope="scope"> |
|||
{{ scope.row.is_urgent ? '是' : '否' }} |
|||
</template> |
|||
</el-table-column> --> |
|||
<!-- <el-table-column prop="workorder_type" label="工单类型" :min-width="flexWidth('workorder_type',crud.data,'工单类型')" />--> |
|||
<!--<el-table-column |
|||
prop="passback_status" |
|||
label="回传MES状态" |
|||
:min-width="flexWidth('passback_status',crud.data,'回传MES状态')" |
|||
/>--> |
|||
<!-- <el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />--> |
|||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" /> |
|||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> |
|||
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" /> |
|||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" /> |
|||
<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.workorder_status!=='1'" |
|||
@click="doOperate(scope.row)" |
|||
>原材料出库</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" /> |
|||
<WorkOrderDetailDialog :dialog-show.sync="workOrderDetailDialog" :message="message" @tableChanged="tableChanged" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudPdmBdWorkorder from './pdmBdWorkorder' |
|||
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 WorkOrderDetailDialog from '@/views/wms/pdm/workerorder/WorkOrderDetailDialog.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: 'PdmBdWorkorder', |
|||
dicts: ['vehicle_type', 'pdm_workorder_status'], |
|||
components: { WorkOrderDetailDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation }, |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '工单管理', |
|||
url: 'api/pdmBdWorkorder', |
|||
idField: 'workorder_id', |
|||
sort: 'workorder_id,desc', |
|||
crudMethod: { ...crudPdmBdWorkorder } |
|||
}) |
|||
}, |
|||
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' } |
|||
] |
|||
}, |
|||
queryTypeOptions: [ |
|||
{ key: 'workorder_code', display_name: '工单编号' }, |
|||
{ key: 'point_code', display_name: '设备编码' } |
|||
], |
|||
workShopList: [], |
|||
regionList: [], |
|||
pointList: [], |
|||
regionCodeParam: null, |
|||
materialDialog: false, |
|||
workOrderDetailDialog: 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.message = row.workorder_code |
|||
this.workOrderDetailDialog = true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,27 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function add(data) { |
|||
return request({ |
|||
url: 'api/pdmBdWorkorder', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function del(ids) { |
|||
return request({ |
|||
url: 'api/pdmBdWorkorder/', |
|||
method: 'delete', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/pdmBdWorkorder', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export default { add, edit, del } |
Loading…
Reference in new issue