fix:coding#413采购和销售部分

This commit is contained in:
shijing 2024-05-23 11:33:53 +08:00
parent 86be993ba0
commit e01877ebd2
6 changed files with 1298 additions and 860 deletions

View File

@ -1,153 +1,230 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.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="number">
</el-table-column>
<el-table-column label="供应商" prop="supplier_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="物料信息" prop="materials_">
<template #default="scope">
<div v-for="item in scope.row.materials_" v-bind:key="item.id">
<span>{{ item.name }}[{{ item.specification }}][{{ item.model }}]</span>
</div>
</template>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label
}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="提交时间" prop="submit_time">
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">
详情
</el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_order.update'"
v-if="scope.row.state == 10">
编辑
</el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_order.submit'"
v-if="scope.row.state == 10">
提交
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_order.delete'"
v-if="scope.row.state == 10">
删除
</el-button>
</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="'pu_order.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="number">
</el-table-column>
<el-table-column
label="供应商"
prop="supplier_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="物料信息" prop="materials_">
<template #default="scope">
<div
v-for="item in scope.row.materials_"
v-bind:key="item.id"
>
<span
>{{ item.name }}[{{ item.specification }}][{{
item.model
}}]</span
>
</div>
</template>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<span
><el-tag
:type="stateOption[scope.row.state].color"
>{{
stateOption[scope.row.state].label
}}</el-tag
></span
>
</template>
</el-table-column>
<el-table-column label="提交时间" prop="submit_time">
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_detail(scope.row)"
>
详情
</el-button>
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_order.update'"
v-if="scope.row.state == 10"
>
编辑
</el-button>
<el-button
link
type="primary"
@click="table_submit(scope.row)"
v-auth="'pu_order.submit'"
v-if="scope.row.state == 10"
>
提交
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_order.delete'"
v-if="scope.row.state == 10"
>
删除
</el-button>
</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-drawer title="订单详情" v-model="dialog.detail" :size="'90%'">
<detail-dialog :orderId="orderId" ref="detailDialogs"> </detail-dialog>
</el-drawer>
</template>
<script>
import saveDialog from "./order_form.vue";
import detailDialog from "./orderitem.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.pum.order.list,
query: {
page: 1,
page_size: 20
},
selection: [],
stateOption: {
10: { "label": "创建中", "color": "" },
20: { "label": "已提交", "color": "" },
30: { "label": "到货中", "color": "" },
40: { "label": "已完成", "color": "success" },
},
name: "rparty",
components: {
saveDialog,
detailDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.pum.order.list,
query: {
page: 1,
page_size: 20,
},
selection: [],
stateOption: {
10: { label: "创建中", color: "" },
20: { label: "已提交", color: "" },
30: { label: "到货中", color: "" },
40: { label: "已完成", color: "success" },
},
orderId: "",
};
},
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_detail(row) {
this.orderId = row.id;
this.dialog.detail = true;
// this.$nextTick(() => {
// this.$router.push({
// name: "orderitem",
// query: {
// pu_order: row.id,
// },
// });
// });
},
table_submit(row) {
this.$API.pum.order.submit.req(row.id).then((res) => {
this.$refs.table.refresh();
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.order.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
};
},
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_detail(row) {
this.$nextTick(() => {
this.$router.push({
name: "orderitem",
query: {
pu_order: row.id
}
});
});
},
table_submit(row) {
console.log(row)
this.$API.pum.order.submit.req(row.id).then((res) => {
this.$refs.table.refresh();
})
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.order.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
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>

View File

@ -1,168 +1,253 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
<el-descriptions-item label="供应商">{{ orderObj.supplier_name }}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{ orderObj.belong_dept_name }}</el-descriptions-item>
<el-descriptions-item label="创建人">{{ orderObj.create_by_name }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ orderObj.create_time }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height:8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button type="primary" @click="addLinkPlanItem" v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10">计划明细变更采购明细</el-button>
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10">手动新增</el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="物料" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<el-table-column label="所需数量" prop="count">
</el-table-column>
<el-table-column label="已到货数量" prop="delivered_count">
</el-table-column>
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip>
</el-table-column>
<el-table-column label="更新时间" prop="update_time" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="100px">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_orderitem.update'"
v-if="orderObj.state == 10">
编辑
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_orderitem.delete'"
v-if="orderObj.state == 10">
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog" :puOrder="puOrder" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<plan-dialog v-if="dialog.plan" ref="planDialog" :puOrder="puOrder" @success="handlePlanSuccess"
@closed="dialog.plan = false"></plan-dialog>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
stateOption[orderObj.state]
}}</el-descriptions-item>
<el-descriptions-item label="供应商">{{
orderObj.supplier_name
}}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{
orderObj.belong_dept_name
}}</el-descriptions-item>
<el-descriptions-item label="创建人">{{
orderObj.create_by_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
orderObj.create_time
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button
type="primary"
@click="addLinkPlanItem"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>计划明细变更采购明细</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>手动新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template>
</el-table-column>
<el-table-column label="所需数量" prop="count">
</el-table-column>
<el-table-column label="已到货数量" prop="delivered_count">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="更新时间"
prop="update_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="left"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_orderitem.update'"
v-if="orderObj.state == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_orderitem.delete'"
v-if="orderObj.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:puOrder="puOrder"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<plan-dialog
v-if="dialog.plan"
ref="planDialog"
:puOrder="puOrder"
@success="handlePlanSuccess"
@closed="dialog.plan = false"
></plan-dialog>
</template>
<script>
import saveDialog from "./orderitem_form.vue";
import planDialog from "./orderitemplan.vue";
export default {
name: "rparty",
components: {
saveDialog, planDialog
},
data() {
return {
dialog: {
save: false,
splan: false,
},
apiObj: null,
params: {},
query: {},
puOrder: '',
orderObj: {},
selection: [],
stateOption: {
10: "创建中",
20: "已提交",
30: "到货中",
40: "已完成",
},
};
},
mounted() {
this.puOrder = this.$route.query.pu_order;
this.params.pu_order = this.$route.query.pu_order;
this.apiObj = this.$API.pum.orderitem.list;
this.getOrder();
},
methods: {
getOrder() {
this.$API.pum.order.item.req(this.puOrder).then((res) => {
this.orderObj = res;
})
},
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
addLinkPlanItem(row) {
this.dialog.plan = true;
this.$nextTick(() => {
this.$refs.planDialog.open();
});
// this.$router.push({
// name: "orderitemplan",
// query:{
// pu_order:this.puOrder
// }
// });
},
name: "rparty",
components: {
saveDialog,
planDialog,
},
props: {
orderId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
save: false,
splan: false,
},
apiObj: null,
params: {
pu_order: "",
},
query: {},
puOrder: "",
orderObj: {},
selection: [],
stateOption: {
10: "创建中",
20: "已提交",
30: "到货中",
40: "已完成",
},
};
},
mounted() {
this.puOrder = this.orderId;
this.params.pu_order = this.orderId;
this.apiObj = this.$API.pum.orderitem.list;
this.getOrder();
},
methods: {
getOrder() {
this.$API.pum.order.item.req(this.puOrder).then((res) => {
this.orderObj = res;
});
},
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
addLinkPlanItem(row) {
this.dialog.plan = true;
this.$nextTick(() => {
this.$refs.planDialog.open();
});
// this.$router.push({
// name: "orderitemplan",
// query:{
// pu_order:this.puOrder
// }
// });
},
//
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);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.orderitem.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
},
handlePlanSuccess() {
this.dialog.plan = false;
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
//
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);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.orderitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
},
handlePlanSuccess() {
this.dialog.plan = false;
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
},
};
</script>
</script>

View File

@ -1,140 +1,214 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_plan.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="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label
}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="提交时间" prop="submit_time" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">详情
</el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_plan.update'"
v-if="scope.row.state == 10">编辑
</el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_plan.submit'"
v-if="scope.row.state == 10">提交
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_plan.delete'"
v-if="scope.row.state == 10">删除
</el-button>
</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="'pu_plan.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="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<span
><el-tag
:type="stateOption[scope.row.state].color"
>{{
stateOption[scope.row.state].label
}}</el-tag
></span
>
</template>
</el-table-column>
<el-table-column
label="提交时间"
prop="submit_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_detail(scope.row)"
>详情
</el-button>
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_plan.update'"
v-if="scope.row.state == 10"
>编辑
</el-button>
<el-button
link
type="primary"
@click="table_submit(scope.row)"
v-auth="'pu_plan.submit'"
v-if="scope.row.state == 10"
>提交
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_plan.delete'"
v-if="scope.row.state == 10"
>删除
</el-button>
</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-drawer title="计划详情" v-model="dialog.detail" :size="'90%'">
<detail-dialog :planId="planId" ref="detailDialogs"> </detail-dialog>
</el-drawer>
</template>
<script>
import saveDialog from "./plan_form.vue";
import detailDialog from "./planitem.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.pum.plan.list,
query: {
page: 1,
page_size: 20,
type: 10
},
selection: [],
stateOption: {
10: { "label": "创建中", "color": "" },
20: { "label": "已提交", "color": "" },
30: { "label": "下单中", "color": "" },
40: { "label": "下单完成", "color": "" },
40: { "label": "已完成", "color": "success" },
},
};
},
methods: {
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_detail(row) {
this.$nextTick(() => {
this.$router.push({
name: "planitem",
query: { pu_plan: row.id }
});
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_submit(row) {
console.log(row.id)
this.$API.pum.plan.submit.req(row.id).then((res) => {
this.$refs.table.refresh();
debugger;
this.$message.success("提交成功");
});
},
//
table_del(row) {
this.$confirm(`确定删除该计划吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.plan.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
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 = {};
},
},
name: "rparty",
components: {
saveDialog,
detailDialog,
},
data() {
return {
dialog: {
save: false,
detail: false,
},
apiObj: this.$API.pum.plan.list,
query: {
page: 1,
page_size: 20,
type: 10,
},
selection: [],
stateOption: {
10: { label: "创建中", color: "" },
20: { label: "已提交", color: "" },
30: { label: "下单中", color: "" },
40: { label: "下单完成", color: "" },
40: { label: "已完成", color: "success" },
},
planId: "",
};
},
methods: {
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_detail(row) {
this.planId = row.id;
this.dialog.detail = true;
// this.$nextTick(() => {
// this.$router.push({
// name: "planitem",
// query: { pu_plan: row.id },
// });
// });
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_submit(row) {
this.$API.pum.plan.submit.req(row.id).then((res) => {
this.$refs.table.refresh();
this.$message.success("提交成功");
});
},
//
table_del(row) {
this.$confirm(`确定删除该计划吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.plan.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
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>

View File

@ -1,156 +1,221 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="计划名称">{{ orderObj.name }}</el-descriptions-item>
<el-descriptions-item label="计划编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height:8px"></div>
<div>
<el-card style="width: 100%" header="计划明细" shadow="hover">
<div>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"
v-if="orderObj.state == 10">新增</el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="所属物料" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<el-table-column label="所属数量" prop="need_count">
</el-table-column>
<el-table-column label="需求日期" prop="need_date" show-overflow-tooltip>
</el-table-column>
<el-table-column label="部门" prop="belong_dept_name">
</el-table-column>
<el-table-column label="关联采购订单" prop="pu_order">
<template #default="scope">
<span v-if="scope.row.pu_order"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="备注" prop="note" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100px">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_planitem.update'"
v-if="orderObj == 10">
编辑
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_planitem.delete'"
v-if="orderObj == 10">
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog" :puPlan="puPlan" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="计划名称">{{
orderObj.name
}}</el-descriptions-item>
<el-descriptions-item label="计划编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{
stateOption[orderObj.state]
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="计划明细" shadow="hover">
<div>
<el-button
type="primary"
icon="el-icon-plus"
v-auth="'pu_planitem.create'"
@click="add"
v-if="orderObj.state == 10"
>新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:query="query"
hidePagination
hideDo
>
<el-table-column type="index" width="50" />
<el-table-column
label="所属物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template>
</el-table-column>
<el-table-column label="所属数量" prop="need_count">
</el-table-column>
<el-table-column
label="需求日期"
prop="need_date"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="部门" prop="belong_dept_name">
</el-table-column>
<el-table-column label="关联采购订单" prop="pu_order">
<template #default="scope">
<span v-if="scope.row.pu_order"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column
label="备注"
prop="note"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_planitem.update'"
v-if="orderObj == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_planitem.delete'"
v-if="orderObj == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:puPlan="puPlan"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from "./planitem_form.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
puPlan: '',
orderObj: {},
apiObj: null,
query: {
page: 1,
page_size: 20
},
stateOption: {
10: "创建中",
20: "已提交",
30: "下单中",
40: "下单完成",
40: "已完成",
},
};
},
mounted() {
this.puPlan = this.$route.query.pu_plan;
this.query.pu_plan = this.$route.query.pu_plan;
this.apiObj = this.$API.pum.planitem.list;
this.$refs.table.refresh();
this.getOrder();
},
methods: {
getOrder() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
debugger;
console.log(res);
this.orderObj = res;
})
},
//
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);
});
},
name: "rparty",
components: {
saveDialog,
},
props: {
planId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
save: false,
},
puPlan: "",
orderObj: {},
apiObj: null,
query: {
page: 1,
page_size: 20,
pu_plan: "",
},
stateOption: {
10: "创建中",
20: "已提交",
30: "下单中",
40: "下单完成",
40: "已完成",
},
};
},
mounted() {
this.puPlan = this.planId;
this.query.pu_plan = this.planId;
this.apiObj = this.$API.pum.planitem.list;
this.$refs.table.refresh();
this.getOrder();
},
methods: {
getOrder() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
this.orderObj = res;
});
},
//
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);
});
},
//
table_del(row) {
this.$confirm(`确定删除该计划详情吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.planitem.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
table_del(row) {
this.$confirm(`确定删除该计划详情吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.pum.planitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
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>

View File

@ -1,148 +1,228 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.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="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
{{ stateOption[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="客户" prop="customer_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="所属合同" prop="contract_number" show-overflow-tooltip>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column label="提交时间" prop="submit_time" width="160">
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="备注">
<template #default="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button link type="primary" @click="table_detail(scope.row)">
详情
</el-button>
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'order.update'"
v-if="scope.row.state == 10">
提交
</el-button>
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'order.submit'"
v-if="scope.row.state == 10">
编辑
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'"
v-if="scope.row.state == 10">
删除
</el-button>
</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="'order.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="number">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
{{ stateOption[scope.row.state] }}
</template>
</el-table-column>
<el-table-column
label="客户"
prop="customer_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="所属合同"
prop="contract_number"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="截止到货日期" prop="delivery_date">
</el-table-column>
<el-table-column
label="提交时间"
prop="submit_time"
width="160"
>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column label="备注">
<template #default="scope">{{
scope.row.description
}}</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="200"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_detail(scope.row)"
>
详情
</el-button>
<el-button
link
type="primary"
@click="table_submit(scope.row)"
v-auth="'order.update'"
v-if="scope.row.state == 10"
>
提交
</el-button>
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'order.submit'"
v-if="scope.row.state == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'order.delete'"
v-if="scope.row.state == 10"
>
删除
</el-button>
</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-drawer title="订单详情" v-model="dialog.detail" :size="'90%'">
<detail-dialog :orderId="orderId" ref="detailDialogs"> </detail-dialog>
</el-drawer>
</template>
<script>
import saveDialog from "./order_form.vue";
import detailDialog from "./orderitem.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: this.$API.sam.order.list,
query: {
page: 1,
page_size: 20
},
selection: [],
stateOption: {
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_submit(row) {
this.$API.sam.order.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
this.handleQuery();
return res;
}).catch((err) => {
return err;
});
},
//
table_detail(row) {
this.$router.push({
name: "samOrderitem",
query: { order: row.id }
name: "rparty",
components: {
saveDialog,
detailDialog,
},
data() {
return {
dialog: {
save: false,
detail: false,
},
apiObj: this.$API.sam.order.list,
query: {
page: 1,
page_size: 20,
},
selection: [],
stateOption: {
10: "创建中",
20: "已提交",
30: "进行中",
40: "已交付",
},
orderId: "",
};
},
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_submit(row) {
this.$API.sam.order.submit
.req(row.id)
.then((res) => {
this.$message.success("提交成功");
this.handleQuery();
return res;
})
.catch((err) => {
return err;
});
},
//
table_detail(row) {
this.orderId = row.id;
this.dialog.detail = true;
// this.$router.push({
// name: "samOrderitem",
// query: { order: row.id }
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.sam.order.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
// });
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.sam.order.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
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>

View File

@ -1,142 +1,199 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
<el-descriptions-item label="客户">{{ orderObj.customer_name }}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{ orderObj.state }}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{ orderObj.delivery_date }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height:8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'order.update'"></el-button>
</div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination>
<el-table-column type="index" width="50" />
<el-table-column label="所需产品" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="客户">{{
orderObj.customer_name
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
orderObj.state
}}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{
orderObj.delivery_date
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'order.update'"
></el-button>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
>
<el-table-column type="index" width="50" />
<el-table-column
label="所需产品"
prop="material"
show-overflow-tooltip
>
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template>
</el-table-column>
<!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.order_"> {{ scope.row.order_.name }}</span>
</template>
</el-table-column> -->
<el-table-column label="所需数量" prop="count">
</el-table-column>
<el-table-column label="已交货数量" prop="delivered_count">
</el-table-column>
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="100px">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'order.update'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog" :orderId="orderId" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<el-table-column label="所需数量" prop="count">
</el-table-column>
<el-table-column label="已交货数量" prop="delivered_count">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'order.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'order.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:orderId="orderId"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from "./orderitem_form.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj: null,
params: {},
orderId: '',
orderObj: {},
selection: [],
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
},
};
},
mounted() {
this.orderId = this.$route.query.order;
this.params.order = this.$route.query.order;
this.apiObj = this.$API.sam.orderitem.list;
this.getOrder();
},
methods: {
getOrder() {
this.$API.sam.order.item.req(this.orderId).then((res) => {
this.orderObj = res;
})
},
//
table_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);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.sam.orderitem.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
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 = {};
},
},
name: "rparty",
components: {
saveDialog,
},
props: {
orderId: {
type: String,
default: "",
},
},
data() {
return {
dialog: {
save: false,
},
apiObj: null,
params: {},
orderObj: {},
selection: [],
state_: {
10: "完好",
20: "限用",
30: "在修",
40: "禁用",
},
};
},
mounted() {
this.params.order = this.orderId;
this.apiObj = this.$API.sam.orderitem.list;
this.getOrder();
},
methods: {
getOrder() {
this.$API.sam.order.item.req(this.orderId).then((res) => {
this.orderObj = res;
});
},
//
table_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);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
this.$API.sam.orderitem.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => {});
},
//
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>