修改物料
This commit is contained in:
parent
1b13f7106b
commit
faefc48a59
@ -35,7 +35,7 @@
|
|||||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" @selection-change="selectionChange">
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe :size="size" highlightCurrentRow @selection-change="selectionChange">
|
||||||
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
<el-table-column type="selection" align="center" width="40"></el-table-column>
|
||||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
<template #business_status="scope">
|
<template #business_status="scope">
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="titleMap[mode]" v-model="visible" :width="500" destroy-on-close @closed="$emit('closed')">
|
<el-dialog :title="titleMap[mode]" v-model="visible" :width="500" destroy-on-close @closed="$emit('closed')">
|
||||||
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px">
|
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px">
|
||||||
<el-form-item label="上级部门" prop="parent_id">
|
<el-form-item label="物料MPN" prop="m_mpn">
|
||||||
<el-cascader v-model="form.parent_id" :options="depts" :props="deptsProps" :show-all-levels="false" clearable style="width: 100%;"></el-cascader>
|
<el-input v-model="form.m_mpn" placeholder="请输入物料MPN" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门名称" prop="name">
|
<el-form-item label="物料名称" prop="m_name">
|
||||||
<el-input v-model="form.name" placeholder="请输入部门名称" clearable></el-input>
|
<el-input v-model="form.m_name" placeholder="请输入物料名称" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="active_status">
|
<el-form-item label="物料成本价" prop="m_price">
|
||||||
<el-switch v-model="form.active_status" :active-value="true" :inactive-value="false"></el-switch>
|
<el-input v-model="form.m_price" placeholder="请输入物料成本价" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="ERP实体ID" prop="f_id">
|
||||||
<el-input v-model="form.remark" clearable type="textarea"></el-input>
|
<el-input v-model="form.f_id" placeholder="请输入ERP实体ID" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -29,39 +29,35 @@ export default {
|
|||||||
mode: "add",
|
mode: "add",
|
||||||
titleMap: {
|
titleMap: {
|
||||||
add: '新增',
|
add: '新增',
|
||||||
edit: '编辑',
|
|
||||||
show: '查看'
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
isSave: false,
|
isSave: false,
|
||||||
//表单数据
|
//表单数据
|
||||||
form: {
|
form: {
|
||||||
parent_id: "",
|
m_mpn: "",
|
||||||
id:"",
|
m_name:"",
|
||||||
name: "",
|
m_price: "",
|
||||||
active_status: true,
|
f_id: ""
|
||||||
remark: ""
|
|
||||||
},
|
},
|
||||||
//验证规则
|
//验证规则
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
m_mpn: [
|
||||||
{required: true, message: '请输入部门名称'}
|
{required: true, message: '请输入物料MPN'}
|
||||||
],
|
],
|
||||||
active_status: [
|
m_name: [
|
||||||
{required: true,}
|
{required: true, message: '请输入物料名称'}
|
||||||
|
],
|
||||||
|
m_price: [
|
||||||
|
{required: true, message: '请输入物料成本价'}
|
||||||
|
],
|
||||||
|
f_id: [
|
||||||
|
{required: true, message: '请输入ERP实体ID'}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
//所需数据选项
|
|
||||||
depts: [],
|
|
||||||
deptsProps: {
|
|
||||||
value: "id",
|
|
||||||
emitPath: false,
|
|
||||||
checkStrictly: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getGroup()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//显示
|
//显示
|
||||||
@ -70,19 +66,13 @@ export default {
|
|||||||
this.visible = true;
|
this.visible = true;
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
//加载树数据
|
|
||||||
async getGroup(){
|
|
||||||
const res = await this.$API.system.dept.active.post();
|
|
||||||
if(res.code == 200){
|
|
||||||
this.depts = res.data;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//表单提交方法
|
//表单提交方法
|
||||||
submit(){
|
submit(){
|
||||||
this.$refs.dialogForm.validate(async (valid) => {
|
this.$refs.dialogForm.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.isSave = true;
|
this.isSave = true;
|
||||||
const res = await this.$API.system.dept.add.post(this.form);
|
const res = await this.$API.setup.material.add.post(this.form);
|
||||||
this.isSave = false;
|
this.isSave = false;
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.$emit('success', this.form, this.mode)
|
this.$emit('success', this.form, this.mode)
|
||||||
@ -92,19 +82,10 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//表单注入数据
|
|
||||||
async setData(data) {
|
|
||||||
let params = {
|
|
||||||
id: data.id
|
|
||||||
}
|
|
||||||
const res = await this.$API.system.dept.info.post(params);
|
|
||||||
if (res.code == 200) {
|
|
||||||
this.form = res.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -27,11 +27,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow>
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow>
|
||||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-dropdown>
|
||||||
|
<el-button class="noBorderBtn" icon="el-icon-more" :size="size"></el-button>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item @click="table_see(scope.row, 'see')" icon="sc-icon-See">查看</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="table_del(scope.row, 'delete')" icon="sc-icon-Delete">删除配置</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
<add-material></add-material>
|
<add-material v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></add-material>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -44,6 +57,9 @@ export default {
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
size:'small',
|
size:'small',
|
||||||
|
dialog:{
|
||||||
|
show:false,
|
||||||
|
},
|
||||||
list:{
|
list:{
|
||||||
apiObj: this.$API.setup.material.list,
|
apiObj: this.$API.setup.material.list,
|
||||||
column:[]
|
column:[]
|
||||||
@ -64,16 +80,6 @@ export default {
|
|||||||
let {params} = item;
|
let {params} = item;
|
||||||
this.params = params;
|
this.params = params;
|
||||||
},
|
},
|
||||||
async save() {
|
|
||||||
const res = await this.$API.setup.room.add.post(this.params);
|
|
||||||
if(res.code == 200){
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
add(){
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// 批量导入
|
// 批量导入
|
||||||
importFile(){
|
importFile(){
|
||||||
@ -104,6 +110,24 @@ export default {
|
|||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
add(){
|
||||||
|
this.dialog.save = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 新增成功
|
||||||
|
handleSuccess(){
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
|
||||||
|
table_see(){
|
||||||
|
|
||||||
|
},
|
||||||
|
table_del(){
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
upSearch(){
|
upSearch(){
|
||||||
this.$refs.table.upData(this.params);
|
this.$refs.table.upData(this.params);
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user