代码更新

This commit is contained in:
2022-09-19 10:48:19 +08:00
parent ce6ce0717b
commit e8063dfb4f
6 changed files with 0 additions and 619 deletions

View File

@@ -1,35 +0,0 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/endrealsemimaterial',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/endrealsemimaterial/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/endrealsemimaterial',
method: 'put',
data
})
}
export function updateRawmaterial(data) {
return request({
url: 'api/endrealsemimaterial/updateRawmaterial',
method: 'put',
data
})
}
export default { add, edit, del, updateRawmaterial }

View File

@@ -1,219 +0,0 @@
<template>
<el-dialog
title="原材料选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="物料类别">
<treeselect
v-model="query.material_type_id"
:load-options="loadClass"
:options="classes"
style="width: 200px;"
placeholder="选择物料类别"
/>
</el-form-item>
<el-form-item label="模糊搜索">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="原材料编码" min-width="150" show-overflow-tooltip />
<el-table-column prop="material_name" label="原材料名称" min-width="200" show-overflow-tooltip />
<el-table-column prop="material_spec" label="原材料规格" show-overflow-tooltip />
<el-table-column prop="material_model" label="型号" />
<el-table-column prop="class_code" label="分类编码" />
<el-table-column prop="class_name" label="物料分类" />
<el-table-column
show-overflow-tooltip
min-width="100"
prop="product_series_name"
label="系列"
/>
<el-table-column prop="unit_name" label="计量单位" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
import crudEndrealsemimaterial from '@/api/wms/basedata/master/endrealsemimaterial'
export default {
name: 'SelectRawMaterialDialog',
components: { rrOperation, pagination, Treeselect },
cruds() {
return CRUD({ title: '物料', url: 'api/Materialbase', crudMethod: { ...crudMaterialbase }, optShow: {}})
},
mixins: [presenter(), header()],
dicts: ['product_series'],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
},
materOptCode: {
type: String,
default: '01'
}
},
data() {
return {
dialogVisible: false,
relation_id: '',
classes: [],
tableRadio: null,
class_idStr: null,
checkrow: null,
rows: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
setForm(relation_id) {
this.relation_id = relation_id
},
clickChange(item) {
this.tableRadio = item
},
open() {
const param = {
'materOpt_code': this.materOptCode
}
crudMaterialbase.getMaterOptType(param).then(res => {
this.class_idStr = res.class_idStr
this.crud.query.class_idStr = res.class_idStr
this.crud.toQuery()
this.queryClassId()
})
},
queryClassId() {
const param = {
'class_idStr': this.class_idStr
}
crudClassstandard.queryClassById(param).then(res => {
this.classes = res.content.map(obj => {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
handleSelectionChange(val, row) {
if (this.isSingle) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.tableRadio)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
crudEndrealsemimaterial.updateRawmaterial({ relation_id: this.relation_id, semi_material_id: this.tableRadio.material_id }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.tableRadio)
})
} else {
crudEndrealsemimaterial.updateRawmaterial({ relation_id: this.relation_id, semi_material_id: '' }).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.tableRadio)
})
}
},
loadClass({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -1,97 +0,0 @@
<template>
<div class="app-container">
<!-- 半成品列表-->
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<label class="el-form-item-label">模糊搜索</label>
<el-input v-model="query.search" clearable size="small" placeholder="输入编码或者名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation />
</div>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
highlight-current-row
style="width: 100%;"
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column prop="material_code" label="成品编码" :min-width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="成品名称" :min-width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" label="成品规格" :min-width="150" show-overflow-tooltip />
<el-table-column prop="class_name" label="成品系列" :min-width="100" show-overflow-tooltip />
<el-table-column prop="ymaterial_code" label="对应半成品编码" :min-width="120" show-overflow-tooltip />
<el-table-column prop="ymaterial_name" label="对应半成品名称" :min-width="180" show-overflow-tooltip />
<el-table-column prop="ymaterial_spec" label="对应半成品规格" :min-width="180" show-overflow-tooltip />
<el-table-column prop="yclass_name" label="对应半成品系列" :min-width="120" show-overflow-tooltip />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addMaterial(scope.row)">添加半成品</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<SelectEndMaterialDialog ref="selectEndMaterialDialog" :dialog-show.sync="selectEndMaterialDialog" @tableChanged3="tableChanged3"/>
</div>
</template>
<script>
import crudEndrealsemimaterial from '@/api/wms/basedata/master/endrealsemimaterial'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import SelectEndMaterialDialog from './SelectEndMaterialDialog'
const defaultForm = { relation_id: null, end_material_id: null, semi_material_id: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
export default {
name: 'Endrealsemimaterial',
components: { pagination, crudOperation, rrOperation, SelectEndMaterialDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: '成品对应半成品', url: 'api/endrealsemimaterial', idField: 'relation_id', sort: 'relation_id,desc',
optShow: {
add: false,
edit: false,
del: false,
download: false,
reset: false
},
crudMethod: { ...crudEndrealsemimaterial }})
},
data() {
return {
selectEndMaterialDialog: false,
permission: {
},
rules: {
}
}
},
methods: {
addMaterial(row) {
this.$refs.selectEndMaterialDialog.setForm(row.relation_id)
this.selectEndMaterialDialog = true
this.$refs.selectEndMaterialDialog.crud.toQuery()
},
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
tableChanged3() {
this.crud.toQuery()
}
}
}
</script>
<style scoped>
</style>