209 lines
6.6 KiB
Vue
209 lines
6.6 KiB
Vue
|
|
<template>
|
|||
|
|
<div class="app-container">
|
|||
|
|
<!--工具栏-->
|
|||
|
|
<div class="head-container">
|
|||
|
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
|||
|
|
<crudOperation :permission="permission">
|
|||
|
|
<el-button
|
|||
|
|
slot="right"
|
|||
|
|
class="filter-item"
|
|||
|
|
type="danger"
|
|||
|
|
icon="el-icon-position"
|
|||
|
|
size="mini"
|
|||
|
|
:disabled="is_disabled(crud.selections.length, crud.selections[0])"
|
|||
|
|
@click="finishd(crud.selections[0])"
|
|||
|
|
>
|
|||
|
|
强制完成
|
|||
|
|
</el-button>
|
|||
|
|
<el-button
|
|||
|
|
slot="right"
|
|||
|
|
class="filter-item"
|
|||
|
|
type="success"
|
|||
|
|
icon="el-icon-position"
|
|||
|
|
size="mini"
|
|||
|
|
@click="synchron()"
|
|||
|
|
>
|
|||
|
|
同步
|
|||
|
|
</el-button>
|
|||
|
|
</crudOperation>
|
|||
|
|
<!--表单组件-->
|
|||
|
|
<el-dialog
|
|||
|
|
:close-on-click-modal="false"
|
|||
|
|
:before-close="crud.cancelCU"
|
|||
|
|
:visible.sync="crud.status.cu > 0"
|
|||
|
|
:title="crud.status.title"
|
|||
|
|
width="550px"
|
|||
|
|
>
|
|||
|
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
|
|||
|
|
<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="物料名称">
|
|||
|
|
<el-input v-model="form.material_name" style="width: 370px;" />
|
|||
|
|
</el-form-item>
|
|||
|
|
<el-form-item label="规格型号">
|
|||
|
|
<el-input v-model="form.material_spec" style="width: 370px;" />
|
|||
|
|
</el-form-item>
|
|||
|
|
<el-form-item label="设备编号" prop="device_code">
|
|||
|
|
<el-select
|
|||
|
|
v-model="form.device_code"
|
|||
|
|
filterable
|
|||
|
|
clearable
|
|||
|
|
size="small"
|
|||
|
|
placeholder="请选择"
|
|||
|
|
class="filter-item"
|
|||
|
|
style="width: 370px"
|
|||
|
|
>
|
|||
|
|
<el-option v-for="item in deviceList" :key="item.device_code" :label="item.device_code" :value="item.device_code" />
|
|||
|
|
</el-select>
|
|||
|
|
</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="工单编码" />
|
|||
|
|
<el-table-column prop="order_status" label="工单状态">
|
|||
|
|
<template slot-scope="scope">
|
|||
|
|
{{ dict.label.order_status[scope.row.order_status] }}
|
|||
|
|
</template>
|
|||
|
|
</el-table-column>
|
|||
|
|
<el-table-column prop="qty" label="下料数量" />
|
|||
|
|
<el-table-column prop="device_code" label="设备编号" min-width="100" show-overflow-tooltip />
|
|||
|
|
<el-table-column prop="material_code" label="物料编码" />
|
|||
|
|
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip />
|
|||
|
|
<el-table-column prop="material_spec" label="规格型号" />
|
|||
|
|
<el-table-column prop="one_qty" label="每箱接料数量" />
|
|||
|
|
<el-table-column prop="is_needmove" label="是否AGV搬运" />
|
|||
|
|
<el-table-column prop="create_by" label="创建者" />
|
|||
|
|
<el-table-column prop="create_time" label="创建时间" min-width="150" show-overflow-tooltip />
|
|||
|
|
</el-table>
|
|||
|
|
<!--分页组件-->
|
|||
|
|
<pagination />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
|||
|
|
import crudOperation from '@crud/CRUD.operation'
|
|||
|
|
import pagination from '@crud/Pagination'
|
|||
|
|
import crudProduceshiftorder from '@/api/acs/order/produceshiftorder'
|
|||
|
|
import deviceCrud from '@/api/acs/device/device'
|
|||
|
|
|
|||
|
|
const defaultForm = {
|
|||
|
|
order_id: null,
|
|||
|
|
order_code: null,
|
|||
|
|
order_status: null,
|
|||
|
|
qty: null,
|
|||
|
|
material_code: null,
|
|||
|
|
material_name: null,
|
|||
|
|
material_uuid: null,
|
|||
|
|
material_spec: null,
|
|||
|
|
create_by: null,
|
|||
|
|
create_time: null,
|
|||
|
|
update_by: null,
|
|||
|
|
update_time: null,
|
|||
|
|
is_deleted: null,
|
|||
|
|
ext_order_id: null,
|
|||
|
|
device_code: null
|
|||
|
|
}
|
|||
|
|
export default {
|
|||
|
|
name: 'Produceshiftorder',
|
|||
|
|
dicts: ['order_status'],
|
|||
|
|
components: { pagination, crudOperation },
|
|||
|
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
|||
|
|
cruds() {
|
|||
|
|
return CRUD({
|
|||
|
|
title: '工单信息',
|
|||
|
|
url: 'api/produceshiftorder',
|
|||
|
|
idField: 'order_id',
|
|||
|
|
sort: 'order_id,desc',
|
|||
|
|
optShow: {
|
|||
|
|
add: true,
|
|||
|
|
edit: false,
|
|||
|
|
del: false,
|
|||
|
|
download: true,
|
|||
|
|
reset: false
|
|||
|
|
},
|
|||
|
|
crudMethod: { ...crudProduceshiftorder }
|
|||
|
|
})
|
|||
|
|
},
|
|||
|
|
data() {
|
|||
|
|
return {
|
|||
|
|
deviceList: [],
|
|||
|
|
permission: {
|
|||
|
|
add: ['admin', 'produceshiftorder:add'],
|
|||
|
|
edit: ['admin', 'produceshiftorder:edit'],
|
|||
|
|
del: ['admin', 'produceshiftorder:del']
|
|||
|
|
},
|
|||
|
|
rules: {
|
|||
|
|
order_code: [
|
|||
|
|
{ required: true, message: '工单编码不能为空', trigger: 'blur' }
|
|||
|
|
],
|
|||
|
|
order_status: [
|
|||
|
|
{ required: true, message: '工单状态不能为空', trigger: 'blur' }
|
|||
|
|
],
|
|||
|
|
qty: [
|
|||
|
|
{ required: true, message: '生产总量不能为空', trigger: 'blur' }
|
|||
|
|
],
|
|||
|
|
material_code: [
|
|||
|
|
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
|||
|
|
],
|
|||
|
|
device_code: [
|
|||
|
|
{ required: true, message: '设备编号不能为空', trigger: 'blur' }
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
created() {
|
|||
|
|
deviceCrud.selectDeviceList().then(data => {
|
|||
|
|
this.deviceList = data
|
|||
|
|
})
|
|||
|
|
},
|
|||
|
|
methods: {
|
|||
|
|
is_disabled(length, data) {
|
|||
|
|
if (length !== 1) {
|
|||
|
|
return true
|
|||
|
|
} else {
|
|||
|
|
return false
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
|||
|
|
[CRUD.HOOK.beforeRefresh]() {
|
|||
|
|
return true
|
|||
|
|
},
|
|||
|
|
finishd(data) {
|
|||
|
|
crudProduceshiftorder.finishd({ data: data }).then(res => {
|
|||
|
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
|||
|
|
this.crud.toQuery()
|
|||
|
|
})
|
|||
|
|
},
|
|||
|
|
synchron() {
|
|||
|
|
crudProduceshiftorder.synchron().then(res => {
|
|||
|
|
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
|||
|
|
this.crud.toQuery()
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<style scoped>
|
|||
|
|
|
|||
|
|
</style>
|