|
@ -12,12 +12,12 @@ |
|
|
label-suffix=":" |
|
|
label-suffix=":" |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
|
<el-form-item label="机台编码"> |
|
|
<el-form-item label="产线"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="query.resource_name" |
|
|
v-model="query.resource_name" |
|
|
clearable |
|
|
clearable |
|
|
size="mini" |
|
|
size="mini" |
|
|
placeholder="机台编码" |
|
|
placeholder="产线" |
|
|
@keyup.enter.native="crud.toQuery" |
|
|
@keyup.enter.native="crud.toQuery" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -108,7 +108,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="机台编码" prop="resource_name"> |
|
|
<el-form-item label="产线" prop="resource_name"> |
|
|
<el-input v-model="form.resource_name" style="width: 250px;" /> |
|
|
<el-input v-model="form.resource_name" style="width: 250px;" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -171,17 +171,82 @@ |
|
|
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.mfg_order_name }}</el-link> |
|
|
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.mfg_order_name }}</el-link> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="status" label="工单状态" :min-width="flexWidth('status',crud.data,'工单状态')" :formatter="formatStatusName" /> |
|
|
<el-table-column |
|
|
<el-table-column prop="resource_name" label="机台编码" :min-width="flexWidth('resource_name',crud.data,'机台编码')" /> |
|
|
prop="status" |
|
|
|
|
|
label="工单状态" |
|
|
|
|
|
:min-width="flexWidth('status',crud.data,'工单状态')" |
|
|
|
|
|
:formatter="formatStatusName" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column prop="resource_name" label="产线" :min-width="flexWidth('resource_name',crud.data,'产线')" /> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="start_device_code" |
|
|
|
|
|
label="起点编码" |
|
|
|
|
|
:min-width="flexWidth('start_device_code',crud.data,'起点编码')" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="next_device_code" |
|
|
|
|
|
label="终点编码" |
|
|
|
|
|
:min-width="flexWidth('next_device_code',crud.data,'终点编码')" |
|
|
|
|
|
/> |
|
|
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品编码')" /> |
|
|
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品编码')" /> |
|
|
<el-table-column prop="description" label="产品名称" :min-width="flexWidth('description',crud.data,'产品名称')" /> |
|
|
<el-table-column prop="description" label="产品名称" :min-width="flexWidth('description',crud.data,'产品名称')" /> |
|
|
<el-table-column prop="total_qty" label="计划重量" :min-width="flexWidth('total_qty',crud.data,'计划重量')" :formatter="crud.formatNum3" /> |
|
|
<el-table-column |
|
|
|
|
|
prop="total_qty" |
|
|
|
|
|
label="计划重量" |
|
|
|
|
|
:min-width="flexWidth('total_qty',crud.data,'计划重量')" |
|
|
|
|
|
:formatter="crud.formatNum3" |
|
|
|
|
|
/> |
|
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> |
|
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> |
|
|
<el-table-column prop="realstart_time" label="开始时间" :min-width="flexWidth('realstart_time',crud.data,'实际开始时间')" /> |
|
|
<el-table-column |
|
|
|
|
|
prop="realstart_time" |
|
|
|
|
|
label="开始时间" |
|
|
|
|
|
:min-width="flexWidth('realstart_time',crud.data,'实际开始时间')" |
|
|
|
|
|
/> |
|
|
<el-table-column prop="realend_time" label="结束时间" :min-width="flexWidth('realend_time',crud.data,'结束时间')" /> |
|
|
<el-table-column prop="realend_time" label="结束时间" :min-width="flexWidth('realend_time',crud.data,'结束时间')" /> |
|
|
<el-table-column prop="update_time" label="更新时间" :min-width="flexWidth('update_time',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"> |
|
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="openEditModal(scope.row)">起点终点确认</el-button> |
|
|
|
|
|
<el-dialog title="更新信息" :visible.sync="dialogVisible" width="40%" append-to-body> |
|
|
|
|
|
<el-form ref="form" :model="form" label-width="100px"> |
|
|
|
|
|
<el-form-item label="起点" prop="start_device_code"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="form.start_point_code" |
|
|
|
|
|
style="width: 370px;" |
|
|
|
|
|
filterable |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
@change="showStartStorage" |
|
|
|
|
|
> |
|
|
|
|
|
<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-item label="终点" prop="start_device_code"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="form.next_point_code" |
|
|
|
|
|
style="width: 370px;" |
|
|
|
|
|
filterable |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
@change="showEndStorage" |
|
|
|
|
|
> |
|
|
|
|
|
<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> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
|
|
|
<el-button type="primary" @click="updateInfo">确 定</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
<udOperation |
|
|
<udOperation |
|
|
:data="scope.row" |
|
|
:data="scope.row" |
|
|
:permission="permission" |
|
|
:permission="permission" |
|
@ -205,11 +270,14 @@ import crudOperation from '@crud/CRUD.operation' |
|
|
import udOperation from '@crud/UD.operation' |
|
|
import udOperation from '@crud/UD.operation' |
|
|
import pagination from '@crud/Pagination' |
|
|
import pagination from '@crud/Pagination' |
|
|
import AddDialog from '@/views/acs/order/AddDialog' |
|
|
import AddDialog from '@/views/acs/order/AddDialog' |
|
|
|
|
|
import deviceCrud from '@/api/acs/device/device' |
|
|
|
|
|
|
|
|
const defaultForm = { |
|
|
const defaultForm = { |
|
|
workorder_id: null, |
|
|
workorder_id: null, |
|
|
container_name: null, |
|
|
container_name: null, |
|
|
resource_name: null, |
|
|
resource_name: null, |
|
|
|
|
|
start_device_code: null, |
|
|
|
|
|
next_device_code: null, |
|
|
mfg_order_name: null, |
|
|
mfg_order_name: null, |
|
|
product_name: null, |
|
|
product_name: null, |
|
|
description: null, |
|
|
description: null, |
|
@ -257,12 +325,19 @@ export default { |
|
|
dialogShow: false, |
|
|
dialogShow: false, |
|
|
openParam: null, |
|
|
openParam: null, |
|
|
permission: {}, |
|
|
permission: {}, |
|
|
|
|
|
dialogVisible: false, |
|
|
|
|
|
deviceList: [], |
|
|
|
|
|
orderDatas: [], |
|
|
|
|
|
form: { |
|
|
|
|
|
start_device_code: '', |
|
|
|
|
|
next_device_code: '' |
|
|
|
|
|
}, |
|
|
rules: { |
|
|
rules: { |
|
|
mfg_order_name: [ |
|
|
mfg_order_name: [ |
|
|
{ required: true, message: '工单号不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '工单号不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
resource_name: [ |
|
|
resource_name: [ |
|
|
{ required: true, message: '机台编码不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '产线不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
total_qty: [ |
|
|
total_qty: [ |
|
|
{ required: true, message: '计划重量不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '计划重量不能为空', trigger: 'blur' } |
|
@ -276,6 +351,11 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
created() { |
|
|
|
|
|
deviceCrud.selectDeviceList().then(data => { |
|
|
|
|
|
this.deviceList = data |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
@ -293,6 +373,37 @@ export default { |
|
|
formatStorIsOrNot(row) { |
|
|
formatStorIsOrNot(row) { |
|
|
return this.dict.label.IS_OR_NOT[row.is_instor] |
|
|
return this.dict.label.IS_OR_NOT[row.is_instor] |
|
|
}, |
|
|
}, |
|
|
|
|
|
openEditModal(row) { |
|
|
|
|
|
this.dialogVisible = true |
|
|
|
|
|
this.orderDatas = row |
|
|
|
|
|
// 可以在这里初始化表单数据,比如从服务器获取 |
|
|
|
|
|
}, |
|
|
|
|
|
updateInfo() { |
|
|
|
|
|
const order = { |
|
|
|
|
|
workorder_id: this.orderDatas.workorder_id, |
|
|
|
|
|
start_device_code: this.form.start_point_code, |
|
|
|
|
|
next_device_code: this.form.next_point_code |
|
|
|
|
|
} |
|
|
|
|
|
crudRawfoilworkorder.updateOrder(order).then(res => { |
|
|
|
|
|
this.crud.toQuery() |
|
|
|
|
|
this.crud.notify('修改成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err.response.data.message) |
|
|
|
|
|
}) |
|
|
|
|
|
this.dialogVisible = false |
|
|
|
|
|
}, |
|
|
|
|
|
update(from, row) { |
|
|
|
|
|
debugger |
|
|
|
|
|
row.start_device_code = form.start_device_code |
|
|
|
|
|
row.next_device_code = form.next_device_code |
|
|
|
|
|
crudRawfoilworkorder.updateOrder(row).then(res => { |
|
|
|
|
|
this.crud.toQuery() |
|
|
|
|
|
this.crud.notify('修改成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err.response.data.message) |
|
|
|
|
|
}) |
|
|
|
|
|
this.dialogVisible = false |
|
|
|
|
|
}, |
|
|
start() { |
|
|
start() { |
|
|
const _selectData = this.$refs.table.selection |
|
|
const _selectData = this.$refs.table.selection |
|
|
const data = _selectData[0] |
|
|
const data = _selectData[0] |
|
@ -318,6 +429,102 @@ export default { |
|
|
this.onSelectAll() |
|
|
this.onSelectAll() |
|
|
this.crud.toQuery() |
|
|
this.crud.toQuery() |
|
|
this.handleCurrentChange(null) |
|
|
this.handleCurrentChange(null) |
|
|
|
|
|
}, |
|
|
|
|
|
showStartStorage(val) { |
|
|
|
|
|
let obj = {} |
|
|
|
|
|
obj = this.deviceList.find((item) => { |
|
|
|
|
|
return item.device_code === val |
|
|
|
|
|
}) |
|
|
|
|
|
if (obj.device_type === 'storage') { |
|
|
|
|
|
this.start_flag = true |
|
|
|
|
|
let storage_obj = {} |
|
|
|
|
|
deviceCrud.queryStorageExtra(obj.device_code).then(data => { |
|
|
|
|
|
storage_obj = data |
|
|
|
|
|
const n1 = storage_obj.minY |
|
|
|
|
|
const n2 = storage_obj.maxY |
|
|
|
|
|
const m1 = storage_obj.minZ |
|
|
|
|
|
const m2 = storage_obj.maxZ |
|
|
|
|
|
const from_y = [] |
|
|
|
|
|
const from_z = [] |
|
|
|
|
|
for (let i = n1; i <= n2; i++) { |
|
|
|
|
|
const y = {} |
|
|
|
|
|
if (i < 10) { |
|
|
|
|
|
y.id = '0' + i |
|
|
|
|
|
} else { |
|
|
|
|
|
y.id = i |
|
|
|
|
|
} |
|
|
|
|
|
y.value = i + '列' |
|
|
|
|
|
from_y.push(y) |
|
|
|
|
|
} |
|
|
|
|
|
for (let i = m1; i <= m2; i++) { |
|
|
|
|
|
const z = {} |
|
|
|
|
|
if (i < 10) { |
|
|
|
|
|
z.id = '0' + i |
|
|
|
|
|
} else { |
|
|
|
|
|
z.id = i |
|
|
|
|
|
} |
|
|
|
|
|
z.value = i + '层' |
|
|
|
|
|
from_z.push(z) |
|
|
|
|
|
} |
|
|
|
|
|
this.fromYList = from_y |
|
|
|
|
|
this.fromZList = from_z |
|
|
|
|
|
this.form.from_x = storage_obj.tunnel |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.start_flag = false |
|
|
|
|
|
this.form.from_x = '' |
|
|
|
|
|
this.form.from_y = '' |
|
|
|
|
|
this.form.from_z = '' |
|
|
|
|
|
} |
|
|
|
|
|
this.isDisabled = false |
|
|
|
|
|
}, |
|
|
|
|
|
showEndStorage(val) { |
|
|
|
|
|
let obj = {} |
|
|
|
|
|
obj = this.deviceList.find((item) => { |
|
|
|
|
|
return item.device_code === val |
|
|
|
|
|
}) |
|
|
|
|
|
if (obj.device_type === 'storage') { |
|
|
|
|
|
this.end_flag = true |
|
|
|
|
|
let storage_obj = {} |
|
|
|
|
|
deviceCrud.queryStorageExtra(obj.device_code).then(data => { |
|
|
|
|
|
storage_obj = data |
|
|
|
|
|
const n1 = storage_obj.minY |
|
|
|
|
|
const n2 = storage_obj.maxY |
|
|
|
|
|
const m1 = storage_obj.minZ |
|
|
|
|
|
const m2 = storage_obj.maxZ |
|
|
|
|
|
const to_y = [] |
|
|
|
|
|
const to_z = [] |
|
|
|
|
|
for (let i = n1; i <= n2; i++) { |
|
|
|
|
|
const y = {} |
|
|
|
|
|
if (i < 10) { |
|
|
|
|
|
y.id = '0' + i |
|
|
|
|
|
} else { |
|
|
|
|
|
y.id = i |
|
|
|
|
|
} |
|
|
|
|
|
y.value = i + '列' |
|
|
|
|
|
to_y.push(y) |
|
|
|
|
|
} |
|
|
|
|
|
for (let i = m1; i <= m2; i++) { |
|
|
|
|
|
const z = {} |
|
|
|
|
|
if (i < 10) { |
|
|
|
|
|
z.id = '0' + i |
|
|
|
|
|
} else { |
|
|
|
|
|
z.id = i |
|
|
|
|
|
} |
|
|
|
|
|
z.value = i + '层' |
|
|
|
|
|
to_z.push(z) |
|
|
|
|
|
} |
|
|
|
|
|
this.toYList = to_y |
|
|
|
|
|
this.toZList = to_z |
|
|
|
|
|
this.form.to_x = storage_obj.tunnel |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.end_flag = false |
|
|
|
|
|
this.form.to_x = '' |
|
|
|
|
|
this.form.to_y = '' |
|
|
|
|
|
this.form.to_z = '' |
|
|
|
|
|
} |
|
|
|
|
|
this.isDisabled = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|