rev:修改工单页面crud

This commit is contained in:
zhangzhiqiang
2023-06-13 08:58:04 +08:00
parent b375c67792
commit 531f9780e1
21 changed files with 595 additions and 125 deletions

View File

@@ -1,45 +1,50 @@
<template>
<div class="app-container">
<!--表单组件-->
<el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible="crud.status.cu > 0"
:title="crud.status.title"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="物料系列" prop="code">
<el-input v-model="form.material_spec" style="width: 370px;" />
</el-form-item>
<el-form-item label="工序调度编号">
<el-input v-model="form.process_id" 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.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!-- 字典列表 -->
<el-card class="box-card">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="设备编号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation :permission="permission" />
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-suffix=":"
>
<el-form-item label="生产车间">
<el-select
v-model="form.product_area"
placeholder=""
style="width: 200px"
>
<el-option
v-for="item in dict.product_area"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="设备编号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="设备编号">
<rrOperation :permission="permission" />
</el-form-item>
</el-form>
</div>
<crudOperation :permission="permission" />
<crudOperation v-show="false" :permission="permission" />
</div>
<!--表格渲染-->
@@ -79,12 +84,6 @@
</template>
</el-table-column>
</el-table>
<MaterDtl
:dialog-show.sync="materialShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<!--分页组件-->
<pagination />
</el-card>
@@ -97,13 +96,13 @@ import CRUD, { presenter, header, form } 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 }
export default {
name: 'SKdevice',
components: { crudOperation, pagination, rrOperation, MaterDtl },
components: { crudOperation, pagination, rrOperation },
dicts: ['product_area'],
cruds() {
return [
CRUD({ title: '深坑设备物料', url: 'api/specialDevice/query', query: { product_area: 'A1', workprocedure_id: '1535144552481034240' }, idField: 'device_code', crudMethod: { ...crudDevice }})
@@ -141,13 +140,6 @@ export default {
}).catch(() => {
})
},
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 替换数据 触发视图更新
}
}
}
</script>

View File

@@ -0,0 +1,156 @@
<template>
<div class="app-container">
<!--表单组件-->
<el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible="crud.status.cu > 0"
:title="crud.status.title"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="物料系列" prop="code">
<el-input v-model="form.material_spec" style="width: 370px;" />
</el-form-item>
<el-form-item label="工序调度编号">
<el-input v-model="form.process_id" 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.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!-- 字典列表 -->
<el-card class="box-card">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="设备编号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation :permission="permission" />
</div>
<crudOperation :permission="permission" />
</div>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
>
<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_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="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>
</template>
</el-table-column>
</el-table>
<MaterDtl
:dialog-show.sync="materialShow"
:is-single="true"
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<!--分页组件-->
<pagination />
</el-card>
</div>
</template>
<script>
import crudDevice from '@/views/wms/device_manage/deviceMaterial/deviceMaterial.js'
import CRUD, { presenter, header, form } 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 }
export default {
name: 'SKdevice',
components: { crudOperation, pagination, rrOperation, MaterDtl },
cruds() {
return [
CRUD({ title: '深坑设备物料', url: 'api/specialDevice/query', query: { product_area: 'A1', workprocedure_id: '1535144552481034240' }, idField: 'device_code', crudMethod: { ...crudDevice }})
]
},
mixins: [presenter(), header(), form(defaultForm)],
data() {
return {
materialShow: false,
queryTypeOptions: [
{ key: 'name', display_name: '字典名称' },
{ key: 'description', display_name: '描述' }
],
rules: {
material_spec: [
{ required: true, message: '请输入编码', trigger: 'blur' }
]
},
permission: {
add: ['admin', 'dict:add'],
edit: ['admin', 'dict:edit'],
del: ['admin', 'dict:del']
}
}
},
methods: {
queryMater(index, row) {
this.materialShow = true
this.nowindex = index
this.nowrow = row
},
updateSKMaterial(row) {
crudDevice.edit(row).then(() => {
this.notify('保存成功', 'success')
}).catch(() => {
})
},
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 替换数据 触发视图更新
}
}
}
</script>
<style scoped>
</style>