loujf
2 years ago
5 changed files with 204 additions and 17 deletions
@ -0,0 +1,35 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function add(data) { |
|||
return request({ |
|||
url: 'api/produceshiftorder', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function del(ids) { |
|||
return request({ |
|||
url: 'api/produceshiftorder/', |
|||
method: 'delete', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
export function finish(order_id) { |
|||
return request({ |
|||
url: 'api/produceshiftorder/finish/' + order_id, |
|||
method: 'post', |
|||
data: order_id |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/produceshiftorder', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export default { add, edit, del, finish } |
@ -0,0 +1,157 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<!-- 搜索 --> |
|||
<el-input |
|||
v-model="query.order_code" |
|||
size="small" |
|||
clearable |
|||
placeholder="输入工单编码或设备编码" |
|||
style="width: 200px;" |
|||
class="filter-item" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
<rrOperation /> |
|||
</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="500px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> |
|||
<el-form-item label="工单编码" prop="order_code"> |
|||
<el-input v-model="form.order_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="设备编码" prop="order_code"> |
|||
<el-input v-model="form.device_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="下料数量" prop="qty"> |
|||
<el-input v-model="form.qty" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="物料编码" prop="material_code"> |
|||
<el-input v-model="form.material_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="物料名称" prop="material_name"> |
|||
<el-input v-model="form.material_name" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="客户编码"> |
|||
<el-input v-model="form.cust_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="客户名称"> |
|||
<el-input v-model="form.cust_name" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="型号"> |
|||
<el-input v-model="form.model" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="熔池"> |
|||
<el-input v-model="form.molten_pool" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="重量"> |
|||
<el-input v-model="form.weight" style="width: 370px;" /> |
|||
</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="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="order_code" label="工单编码" min-width="120" show-overflow-tooltip /> |
|||
<el-table-column prop="device_code" label="设备编码" /> |
|||
<el-table-column prop="order_status_name" label="工单状态" /> |
|||
<el-table-column prop="qty" label="下料数量" /> |
|||
<el-table-column prop="material_code" label="物料编码" /> |
|||
<el-table-column prop="material_name" label="物料名称" /> |
|||
<el-table-column prop="cust_code" label="客户编码" /> |
|||
<el-table-column prop="cust_name" label="客户名称" /> |
|||
<el-table-column prop="model" label="型号" /> |
|||
<el-table-column prop="molten_pool" label="熔池" /> |
|||
<el-table-column prop="weight" label="重量" /> |
|||
<el-table-column prop="create_by" label="创建者" /> |
|||
<el-table-column prop="create_time" label="创建时间" min-width="150" show-overflow-tooltip /> |
|||
<el-table-column v-permission="['admin','produceshiftorder:edit','produceshiftorder:del']" label="操作" width="160px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<udOperation |
|||
style="display: inline" |
|||
:data="scope.row" |
|||
:permission="permission" |
|||
/> |
|||
<el-button slot="right" size="mini" type="text" @click="finish(scope.$index, scope.row)"> |
|||
完成 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
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 crudProduceshiftorder from '@/api/acs/produceshiftorder/produceshiftorder' |
|||
import crudTask from '@/api/acs/task/task' |
|||
|
|||
const defaultForm = { order_id: null, order_code: null, is_unbundling: null, order_status: null, qty: null, product_code: null, material_code: null, material_name: null, material_uuid: null, cust_code: null, cust_name: null, model: null, molten_pool: null, weight: null, create_by: null, create_time: null, update_by: null, update_time: null, is_deleted: null } |
|||
export default { |
|||
name: 'Produceshiftorder', |
|||
// eslint-disable-next-line vue/no-unused-components |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ title: '工单信息', url: 'api/produceshiftorder', idField: 'create_time', sort: 'create_time,desc', crudMethod: { ...crudProduceshiftorder }}) |
|||
}, |
|||
data() { |
|||
return { |
|||
permission: { |
|||
add: ['admin', 'produceshiftorder:add'], |
|||
edit: ['admin', 'produceshiftorder:edit'], |
|||
del: ['admin', 'produceshiftorder:del'] |
|||
}, |
|||
rules: { |
|||
order_code: [ |
|||
{ required: true, message: '工单编码不能为空', trigger: 'blur' } |
|||
], |
|||
qty: [ |
|||
{ required: true, message: '下料数量不能为空', trigger: 'blur' } |
|||
], |
|||
product_code: [ |
|||
{ required: true, message: '产品编码不能为空', trigger: 'blur' } |
|||
], |
|||
material_code: [ |
|||
{ required: true, message: '物料编码不能为空', trigger: 'blur' } |
|||
], |
|||
material_name: [ |
|||
{ required: true, message: '物料名称不能为空', trigger: 'blur' } |
|||
] |
|||
}} |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
}, |
|||
finish(index, row) { |
|||
debugger |
|||
crudProduceshiftorder.finish(row.order_id).then(res => { |
|||
this.crud.toQuery() |
|||
this.crud.notify('完成成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
}).catch(err => { |
|||
console.log(err.response.data.message) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue