fix:小问题修改
This commit is contained in:
parent
029d881774
commit
75a0dc33ce
|
@ -48,11 +48,12 @@
|
|||
<el-select
|
||||
v-model="form.material"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materials"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:label="item.full_name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
|
|
|
@ -1,121 +1,175 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'supplier.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="供应商名称" prop="name" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人" prop="contact">
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" prop="contact_phone">
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" prop="address" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="120px">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'supplier.update'">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row)" v-auth="'supplier.delete'">
|
||||
<template #reference>
|
||||
<el-button link type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"></save-dialog>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
v-auth="'supplier.create'"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
clearable
|
||||
style="margin-right: 5px"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:params="query"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="供应商名称"
|
||||
prop="name"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人" prop="contact">
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" prop="contact_phone">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="地址"
|
||||
prop="address"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否外协" prop="can_outsource">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.can_outsource" type="success"
|
||||
>是</el-tag
|
||||
>
|
||||
<el-tag v-else type="waring">否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="120px"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'supplier.update'"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="table_del(scope.row)"
|
||||
v-auth="'supplier.delete'"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button link type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./supplier_form.vue";
|
||||
export default {
|
||||
name: "rparty",
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
apiObj: this.$API.pum.supplier.list,
|
||||
query: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
type: 10
|
||||
},
|
||||
selection: [],
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$API.pum.supplier.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
name: "rparty",
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
apiObj: this.$API.pum.supplier.list,
|
||||
query: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
type: 10,
|
||||
},
|
||||
selection: [],
|
||||
state_: {
|
||||
10: "完好",
|
||||
20: "限用",
|
||||
30: "在修",
|
||||
40: "禁用",
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$API.pum.supplier.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -188,6 +188,7 @@
|
|||
ref="saveDialog"
|
||||
:mlog="mlogId"
|
||||
:mgroup="mgroup"
|
||||
:materialIn="materialIn"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
|
@ -330,6 +331,7 @@ export default {
|
|||
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
|
||||
that.mlogItem = res;
|
||||
that.mgroup = res.mgroup;
|
||||
that.materialIn = res.material_in;
|
||||
that.belongDeptId = res.belong_dept;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -130,6 +130,26 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="生产类型" prop="mtype">
|
||||
<el-select
|
||||
v-model="form.mtype"
|
||||
placeholder="生产类型"
|
||||
clearable
|
||||
:disabled="mode == 'edit'"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
label="自产"
|
||||
value="10"
|
||||
></el-option>
|
||||
<el-option
|
||||
label="外协"
|
||||
value="20"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
|
@ -200,6 +220,13 @@ export default {
|
|||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
mtype: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择生产类型",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.material_out_name"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>{{ item.material_out_name }}</span>
|
||||
<!-- <span>{{ item.material_out_name }}</span>/ -->
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -46,6 +46,15 @@
|
|||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<span>{{ item.batch }}</span
|
||||
><span>{{ item.count }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -86,6 +95,10 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
materialIn: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
|
@ -142,7 +155,11 @@ export default {
|
|||
getMaterial() {
|
||||
let that = this;
|
||||
this.$API.wpm.wmaterial.list
|
||||
.req({ mgroupx: that.mgroup, page: 0 })
|
||||
.req({
|
||||
mgroupx: that.mgroup,
|
||||
material: that.materialIn,
|
||||
page: 0,
|
||||
})
|
||||
.then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue