rev:刻字包装任务/工序/工单merge
This commit is contained in:
@@ -14,6 +14,12 @@ export function edit(data) {
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}export function setEmp(data) {
|
||||
return request({
|
||||
url: 'api/specialDevice/setEmp',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { query, edit }
|
||||
export default { query, setEmp, edit }
|
||||
|
||||
@@ -39,14 +39,55 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号">
|
||||
<el-form-item >
|
||||
<rrOperation :permission="permission" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation v-show="false" :permission="permission" />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="setEmpty(crud.selections)"
|
||||
>
|
||||
设置空位
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync=pointMVisible
|
||||
title="点位物料信息"
|
||||
width="540px"
|
||||
@close="materiValueCancel()"
|
||||
>
|
||||
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="materialForm.material_code" clearable @clear="materialForm.material_code='',materialForm.material_id='',materialForm.material_spec=''" style="width: 370px">
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料数量(个)" prop="deviceinstor_qty">
|
||||
<el-input-number v-model="materialForm.deviceinstor_qty" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料重量(g)" prop="deviceinstor_weight">
|
||||
<el-input-number v-model="materialForm.deviceinstor_weight" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="materiValueCancel()">取消</el-button>
|
||||
<el-button type="primary" @click="pointMateriSubmit()">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -59,27 +100,20 @@
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="product_area" label="生产车间" width="100px" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="设备编码" width="100px" show-overflow-tooltip />
|
||||
<el-table-column prop="material_id" label="物料id" width="200px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.material_id">
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="物料名称" width="200px" show-overflow-tooltip />
|
||||
<el-table-column prop="material_id" label="物料id" width="200px" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编码" width="200px" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="200px" show-overflow-toolti />
|
||||
<el-table-column prop="deviceinstor_qty" label="物料数量(单位:个)" align="center" width="120px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.deviceinstor_qty" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deviceinstor_weight" label="物料重量(单位:g)" align="center" width="120px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.deviceinstor_weight" /></template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deviceinstor_qty" label="物料数量(个)" align="center" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="deviceinstor_weight" label="物料重量(g)" align="center" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" style="margin-left: -1px;margin-right: 2px" type="text" @click="updateSKMaterial(scope.row)">提交修改</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
slot="left"
|
||||
@click="toEditMaterial(scope.row)">
|
||||
修改
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -98,13 +132,13 @@
|
||||
|
||||
<script>
|
||||
import crudDevice from '@/views/wms/device_manage/deviceMaterial/deviceMaterial.js'
|
||||
import CRUD, { presenter, header, form } from '@crud/crud'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
|
||||
const defaultForm = { product_area: 'A1', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
|
||||
const defaultForm = { product_area: 'A1', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null,material_code: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
|
||||
|
||||
export default {
|
||||
name: 'SKdevice',
|
||||
@@ -112,14 +146,21 @@ export default {
|
||||
dicts: ['product_area'],
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({ title: '深坑设备物料', url: 'api/specialDevice/query', query: { product_area: 'A1', workprocedure_id: '1535144552481034240' }, idField: 'device_code', crudMethod: { ...crudDevice }})
|
||||
CRUD({ title: '深坑设备物料', url: 'api/specialDevice/query', query: { product_area: 'A1', workprocedure_id: '1535144552481034240' }, idField: 'device_code', crudMethod: { ...crudDevice },
|
||||
optShow: {add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true}})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
mixins: [presenter(), header(), form(defaultForm),crud()],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
materialShow: false,
|
||||
pointMVisible: false,
|
||||
materialForm:{},
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '字典名称' },
|
||||
{ key: 'description', display_name: '描述' }
|
||||
@@ -130,19 +171,52 @@ export default {
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setEmpty(rows) {
|
||||
var points = []
|
||||
rows.forEach((item) => {
|
||||
points.push(item.device_code)
|
||||
})
|
||||
crudDevice.setEmp(points).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.materiValueCancel()
|
||||
this.crud.refresh()
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
toEditMaterial(row) {
|
||||
this.pointMVisible = true
|
||||
this.materialForm = JSON.parse(JSON.stringify(row))
|
||||
},
|
||||
setMaterValue(row) {
|
||||
this.nowrow.material_id = row.material_id
|
||||
this.nowrow.material_code = row.material_code
|
||||
this.nowrow.material_name = row.material_name
|
||||
this.nowrow.material_spec = row.material_spec
|
||||
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||
this.materialForm.material_id = row.material_id
|
||||
this.materialForm.material_code = row.material_code
|
||||
this.materialForm.material_name = row.material_name
|
||||
this.materialForm.material_spec = row.material_spec // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
materiValueCancel(){
|
||||
this.materialForm = {}
|
||||
this.dialogVisible = false
|
||||
this.pointMVisible = false
|
||||
},
|
||||
materiCancel(){
|
||||
this.materialForm.material_id = ""
|
||||
this.materialForm.material_code = ""
|
||||
this.materialForm.material_name = ""
|
||||
},
|
||||
pointMateriSubmit(){
|
||||
console.log(this.materialForm)
|
||||
crudDevice.edit(this.materialForm).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.materiValueCancel()
|
||||
this.crud.refresh()
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
queryMater(index, row) {
|
||||
this.materialShow = true
|
||||
|
||||
Reference in New Issue
Block a user