zds
5 months ago
15 changed files with 454 additions and 7 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,226 @@ |
|||
<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: 'moveStor', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
mixins: [presenter(), header(), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '缓存区一键移库', |
|||
url: 'api/report/yl/movedetail', |
|||
idField: 'pointCode', |
|||
sort: 'pointCode,desc', |
|||
optShow: { |
|||
add: false, |
|||
edit: false, |
|||
del: false, |
|||
download: false, |
|||
reset: false |
|||
}, |
|||
query: {} |
|||
}) |
|||
}, |
|||
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.$axios.post('/api/workorder/batchCreate', { |
|||
pointCodes: pointCodes, |
|||
status: '1' |
|||
}).then(response => { |
|||
// 提交成功处理 |
|||
this.$message.success('移库提交成功!') |
|||
this.crud.toQuery() |
|||
}).catch(error => { |
|||
// 提交失败处理 |
|||
this.$message.error('移库提交失败,请重试') |
|||
}) |
|||
}, |
|||
autoMove(){ |
|||
this.dialogVisible = true |
|||
}, |
|||
confirmMove(){///api/schBaseTask/move |
|||
this.$axios.post('/api/schBaseTask/move', { }) |
|||
.then(response => { |
|||
// 提交成功处理 |
|||
this.$message.success('一键移库提交成功!') |
|||
console.log(response.data) |
|||
}) |
|||
.catch(error => { |
|||
// 提交失败处理 |
|||
this.$message.error('一键移库提交失败,请重试') |
|||
console.error(error) |
|||
}) .finally(() => { |
|||
this.dialogVisible = false // Close the dialog |
|||
}) |
|||
}, |
|||
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('YLHC').then(res => { |
|||
this.pointList = res |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue