fix:coding#413采购和销售部分
This commit is contained in:
parent
86be993ba0
commit
e01877ebd2
|
|
@ -1,153 +1,230 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.create'">新增</el-button>
|
<el-button
|
||||||
</div>
|
type="primary"
|
||||||
<div class="right-panel">
|
icon="el-icon-plus"
|
||||||
<el-input v-model="query.search" placeholder="订单编号" clearable style="margin-right: 5px;"></el-input>
|
@click="add"
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
v-auth="'pu_order.create'"
|
||||||
</div>
|
>新增</el-button
|
||||||
</el-header>
|
>
|
||||||
<el-main class="nopadding">
|
</div>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
|
<div class="right-panel">
|
||||||
<el-table-column type="index" width="50" />
|
<el-input
|
||||||
<el-table-column label="订单编号" prop="number">
|
v-model="query.search"
|
||||||
</el-table-column>
|
placeholder="订单编号"
|
||||||
<el-table-column label="供应商" prop="supplier_name" show-overflow-tooltip>
|
clearable
|
||||||
</el-table-column>
|
style="margin-right: 5px"
|
||||||
<el-table-column label="物料信息" prop="materials_">
|
></el-input>
|
||||||
<template #default="scope">
|
<el-button
|
||||||
<div v-for="item in scope.row.materials_" v-bind:key="item.id">
|
type="primary"
|
||||||
<span>{{ item.name }}[{{ item.specification }}][{{ item.model }}]</span>
|
icon="el-icon-search"
|
||||||
</div>
|
@click="handleQuery"
|
||||||
</template>
|
></el-button>
|
||||||
</el-table-column>
|
</div>
|
||||||
<el-table-column label="截止到货日期" prop="delivery_date">
|
</el-header>
|
||||||
</el-table-column>
|
<el-main class="nopadding">
|
||||||
<el-table-column label="状态" prop="state">
|
<scTable
|
||||||
<template #default="scope">
|
ref="table"
|
||||||
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label
|
:apiObj="apiObj"
|
||||||
}}</el-tag></span>
|
row-key="id"
|
||||||
</template>
|
stripe
|
||||||
</el-table-column>
|
:params="query"
|
||||||
<el-table-column label="提交时间" prop="submit_time">
|
>
|
||||||
</el-table-column>
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="创建人" prop="create_by_name">
|
<el-table-column label="订单编号" prop="number">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
<el-table-column
|
||||||
<template #default="scope">
|
label="供应商"
|
||||||
<el-button link type="primary" @click="table_detail(scope.row)">
|
prop="supplier_name"
|
||||||
详情
|
show-overflow-tooltip
|
||||||
</el-button>
|
>
|
||||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_order.update'"
|
</el-table-column>
|
||||||
v-if="scope.row.state == 10">
|
<el-table-column label="物料信息" prop="materials_">
|
||||||
编辑
|
<template #default="scope">
|
||||||
</el-button>
|
<div
|
||||||
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_order.submit'"
|
v-for="item in scope.row.materials_"
|
||||||
v-if="scope.row.state == 10">
|
v-bind:key="item.id"
|
||||||
提交
|
>
|
||||||
</el-button>
|
<span
|
||||||
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_order.delete'"
|
>{{ item.name }}[{{ item.specification }}][{{
|
||||||
v-if="scope.row.state == 10">
|
item.model
|
||||||
删除
|
}}]</span
|
||||||
</el-button>
|
>
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
</template>
|
||||||
</scTable>
|
</el-table-column>
|
||||||
</el-main>
|
<el-table-column label="截止到货日期" prop="delivery_date">
|
||||||
</el-container>
|
</el-table-column>
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
|
<el-table-column label="状态" prop="state">
|
||||||
@closed="dialog.save = false"></save-dialog>
|
<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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./order_form.vue";
|
import saveDialog from "./order_form.vue";
|
||||||
|
import detailDialog from "./orderitem.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "rparty",
|
name: "rparty",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
},
|
detailDialog,
|
||||||
data() {
|
},
|
||||||
return {
|
data() {
|
||||||
dialog: {
|
return {
|
||||||
save: false,
|
dialog: {
|
||||||
},
|
save: false,
|
||||||
apiObj: this.$API.pum.order.list,
|
},
|
||||||
query: {
|
apiObj: this.$API.pum.order.list,
|
||||||
page: 1,
|
query: {
|
||||||
page_size: 20
|
page: 1,
|
||||||
},
|
page_size: 20,
|
||||||
selection: [],
|
},
|
||||||
stateOption: {
|
selection: [],
|
||||||
10: { "label": "创建中", "color": "" },
|
stateOption: {
|
||||||
20: { "label": "已提交", "color": "" },
|
10: { label: "创建中", color: "" },
|
||||||
30: { "label": "到货中", "color": "" },
|
20: { label: "已提交", color: "" },
|
||||||
40: { "label": "已完成", "color": "success" },
|
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(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
};
|
//本地更新数据
|
||||||
},
|
handleSaveSuccess(data, mode) {
|
||||||
methods: {
|
if (mode == "add") {
|
||||||
//添加
|
this.$refs.table.refresh();
|
||||||
add() {
|
} else if (mode == "edit") {
|
||||||
this.dialog.save = true;
|
this.$refs.table.refresh();
|
||||||
this.$nextTick(() => {
|
}
|
||||||
this.$refs.saveDialog.open("add");
|
},
|
||||||
});
|
handleQuery() {
|
||||||
},
|
this.$refs.table.queryData(this.query);
|
||||||
//编辑
|
},
|
||||||
table_edit(row) {
|
resetQuery() {
|
||||||
this.dialog.save = true;
|
this.query = {};
|
||||||
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 = {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,168 +1,253 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="padding: 8px">
|
<div style="padding: 8px">
|
||||||
<div>
|
<div>
|
||||||
<el-card style="width: 100%" header="基本信息" shadow="hover">
|
<el-card style="width: 100%" header="基本信息" shadow="hover">
|
||||||
<el-descriptions>
|
<el-descriptions>
|
||||||
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
|
<el-descriptions-item label="订单编号">{{
|
||||||
<el-descriptions-item label="订单状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
|
orderObj.number
|
||||||
<el-descriptions-item label="供应商">{{ orderObj.supplier_name }}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="所属部门">{{ orderObj.belong_dept_name }}</el-descriptions-item>
|
<el-descriptions-item label="订单状态">{{
|
||||||
<el-descriptions-item label="创建人">{{ orderObj.create_by_name }}</el-descriptions-item>
|
stateOption[orderObj.state]
|
||||||
<el-descriptions-item label="创建时间">{{ orderObj.create_time }}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
</el-descriptions>
|
<el-descriptions-item label="供应商">{{
|
||||||
</el-card>
|
orderObj.supplier_name
|
||||||
</div>
|
}}</el-descriptions-item>
|
||||||
<div style="height:8px"></div>
|
<el-descriptions-item label="所属部门">{{
|
||||||
<div>
|
orderObj.belong_dept_name
|
||||||
<el-card style="width: 100%" header="订单明细" shadow="hover">
|
}}</el-descriptions-item>
|
||||||
<div>
|
<el-descriptions-item label="创建人">{{
|
||||||
<el-button type="primary" @click="addLinkPlanItem" v-auth="'pu_orderitem.create'"
|
orderObj.create_by_name
|
||||||
v-if="orderObj.state == 10">计划明细变更采购明细</el-button>
|
}}</el-descriptions-item>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"
|
<el-descriptions-item label="创建时间">{{
|
||||||
v-if="orderObj.state == 10">手动新增</el-button>
|
orderObj.create_time
|
||||||
</div>
|
}}</el-descriptions-item>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination hideDo>
|
</el-descriptions>
|
||||||
<el-table-column type="index" width="50" />
|
</el-card>
|
||||||
<el-table-column label="物料" prop="material" show-overflow-tooltip>
|
</div>
|
||||||
<template #default="scope">
|
<div style="height: 8px"></div>
|
||||||
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
|
<div>
|
||||||
</template>
|
<el-card style="width: 100%" header="订单明细" shadow="hover">
|
||||||
</el-table-column>
|
<div>
|
||||||
<el-table-column label="所需数量" prop="count">
|
<el-button
|
||||||
</el-table-column>
|
type="primary"
|
||||||
<el-table-column label="已到货数量" prop="delivered_count">
|
@click="addLinkPlanItem"
|
||||||
</el-table-column>
|
v-auth="'pu_orderitem.create'"
|
||||||
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip>
|
v-if="orderObj.state == 10"
|
||||||
</el-table-column>
|
>计划明细变更采购明细</el-button
|
||||||
<el-table-column label="更新时间" prop="update_time" show-overflow-tooltip>
|
>
|
||||||
</el-table-column>
|
<el-button
|
||||||
<el-table-column label="操作" fixed="right" align="left" width="100px">
|
type="primary"
|
||||||
<template #default="scope">
|
icon="el-icon-plus"
|
||||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_orderitem.update'"
|
@click="add"
|
||||||
v-if="orderObj.state == 10">
|
v-auth="'pu_orderitem.create'"
|
||||||
编辑
|
v-if="orderObj.state == 10"
|
||||||
</el-button>
|
>手动新增</el-button
|
||||||
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_orderitem.delete'"
|
>
|
||||||
v-if="orderObj.state == 10">
|
</div>
|
||||||
删除
|
<scTable
|
||||||
</el-button>
|
ref="table"
|
||||||
</template>
|
:apiObj="apiObj"
|
||||||
</el-table-column>
|
row-key="id"
|
||||||
</scTable>
|
stripe
|
||||||
</el-card>
|
:params="params"
|
||||||
</div>
|
:query="query"
|
||||||
</div>
|
hidePagination
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" :puOrder="puOrder" @success="handleSaveSuccess"
|
hideDo
|
||||||
@closed="dialog.save = false"></save-dialog>
|
>
|
||||||
<plan-dialog v-if="dialog.plan" ref="planDialog" :puOrder="puOrder" @success="handlePlanSuccess"
|
<el-table-column type="index" width="50" />
|
||||||
@closed="dialog.plan = false"></plan-dialog>
|
<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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./orderitem_form.vue";
|
import saveDialog from "./orderitem_form.vue";
|
||||||
import planDialog from "./orderitemplan.vue";
|
import planDialog from "./orderitemplan.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "rparty",
|
name: "rparty",
|
||||||
components: {
|
components: {
|
||||||
saveDialog, planDialog
|
saveDialog,
|
||||||
},
|
planDialog,
|
||||||
data() {
|
},
|
||||||
return {
|
props: {
|
||||||
dialog: {
|
orderId: {
|
||||||
save: false,
|
type: String,
|
||||||
splan: false,
|
default: "",
|
||||||
},
|
},
|
||||||
apiObj: null,
|
},
|
||||||
params: {},
|
data() {
|
||||||
query: {},
|
return {
|
||||||
puOrder: '',
|
dialog: {
|
||||||
orderObj: {},
|
save: false,
|
||||||
selection: [],
|
splan: false,
|
||||||
stateOption: {
|
},
|
||||||
10: "创建中",
|
apiObj: null,
|
||||||
20: "已提交",
|
params: {
|
||||||
30: "到货中",
|
pu_order: "",
|
||||||
40: "已完成",
|
},
|
||||||
},
|
query: {},
|
||||||
};
|
puOrder: "",
|
||||||
},
|
orderObj: {},
|
||||||
mounted() {
|
selection: [],
|
||||||
this.puOrder = this.$route.query.pu_order;
|
stateOption: {
|
||||||
this.params.pu_order = this.$route.query.pu_order;
|
10: "创建中",
|
||||||
this.apiObj = this.$API.pum.orderitem.list;
|
20: "已提交",
|
||||||
this.getOrder();
|
30: "到货中",
|
||||||
},
|
40: "已完成",
|
||||||
methods: {
|
},
|
||||||
getOrder() {
|
};
|
||||||
this.$API.pum.order.item.req(this.puOrder).then((res) => {
|
},
|
||||||
this.orderObj = res;
|
mounted() {
|
||||||
})
|
this.puOrder = this.orderId;
|
||||||
},
|
this.params.pu_order = this.orderId;
|
||||||
//添加
|
this.apiObj = this.$API.pum.orderitem.list;
|
||||||
add() {
|
this.getOrder();
|
||||||
this.dialog.save = true;
|
},
|
||||||
this.$nextTick(() => {
|
methods: {
|
||||||
this.$refs.saveDialog.open("add");
|
getOrder() {
|
||||||
});
|
this.$API.pum.order.item.req(this.puOrder).then((res) => {
|
||||||
},
|
this.orderObj = res;
|
||||||
addLinkPlanItem(row) {
|
});
|
||||||
this.dialog.plan = true;
|
},
|
||||||
this.$nextTick(() => {
|
//添加
|
||||||
this.$refs.planDialog.open();
|
add() {
|
||||||
});
|
this.dialog.save = true;
|
||||||
// this.$router.push({
|
this.$nextTick(() => {
|
||||||
// name: "orderitemplan",
|
this.$refs.saveDialog.open("add");
|
||||||
// query:{
|
});
|
||||||
// pu_order:this.puOrder
|
},
|
||||||
// }
|
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) {
|
table_edit(row) {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.saveDialog.open("edit").setData(row);
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//查看
|
//查看
|
||||||
table_show(row) {
|
table_show(row) {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.saveDialog.open("show").setData(row);
|
this.$refs.saveDialog.open("show").setData(row);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//删除
|
//删除
|
||||||
table_del(row) {
|
table_del(row) {
|
||||||
this.$confirm(`确定删除吗?`, "提示", {
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
})
|
||||||
this.$API.pum.orderitem.delete.req(row.id).then((res) => {
|
.then(() => {
|
||||||
this.$message.success("删除成功");
|
this.$API.pum.orderitem.delete
|
||||||
this.$refs.table.refresh();
|
.req(row.id)
|
||||||
return res;
|
.then((res) => {
|
||||||
}).catch((err) => {
|
this.$message.success("删除成功");
|
||||||
return err;
|
this.$refs.table.refresh();
|
||||||
});
|
return res;
|
||||||
}).catch(() => { });
|
})
|
||||||
},
|
.catch((err) => {
|
||||||
//本地更新数据
|
return err;
|
||||||
handleSaveSuccess(data, mode) {
|
});
|
||||||
if (mode == "add") {
|
})
|
||||||
this.$refs.table.refresh();
|
.catch(() => {});
|
||||||
} else if (mode == "edit") {
|
},
|
||||||
this.$refs.table.refresh();
|
//本地更新数据
|
||||||
}
|
handleSaveSuccess(data, mode) {
|
||||||
},
|
if (mode == "add") {
|
||||||
handlePlanSuccess() {
|
this.$refs.table.refresh();
|
||||||
this.dialog.plan = false;
|
} else if (mode == "edit") {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
},
|
}
|
||||||
handleQuery() {
|
},
|
||||||
this.$refs.table.queryData(this.query)
|
handlePlanSuccess() {
|
||||||
},
|
this.dialog.plan = false;
|
||||||
resetQuery() {
|
this.$refs.table.refresh();
|
||||||
this.query = {};
|
},
|
||||||
},
|
handleQuery() {
|
||||||
},
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,140 +1,214 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_plan.create'">新增</el-button>
|
<el-button
|
||||||
</div>
|
type="primary"
|
||||||
<div class="right-panel">
|
icon="el-icon-plus"
|
||||||
<el-input v-model="query.search" placeholder="计划编号" clearable style="margin-right: 5px;"></el-input>
|
@click="add"
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
v-auth="'pu_plan.create'"
|
||||||
</div>
|
>新增</el-button
|
||||||
</el-header>
|
>
|
||||||
<el-main class="nopadding">
|
</div>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
|
<div class="right-panel">
|
||||||
<el-table-column type="index" width="50" />
|
<el-input
|
||||||
<el-table-column label="计划名称" prop="name" show-overflow-tooltip>
|
v-model="query.search"
|
||||||
</el-table-column>
|
placeholder="计划编号"
|
||||||
<el-table-column label="计划编号" prop="number">
|
clearable
|
||||||
</el-table-column>
|
style="margin-right: 5px"
|
||||||
<el-table-column label="状态" prop="state">
|
></el-input>
|
||||||
<template #default="scope">
|
<el-button
|
||||||
<span><el-tag :type="stateOption[scope.row.state].color">{{ stateOption[scope.row.state].label
|
type="primary"
|
||||||
}}</el-tag></span>
|
icon="el-icon-search"
|
||||||
</template>
|
@click="handleQuery"
|
||||||
</el-table-column>
|
></el-button>
|
||||||
<el-table-column label="提交时间" prop="submit_time" show-overflow-tooltip>
|
</div>
|
||||||
</el-table-column>
|
</el-header>
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
<el-main class="nopadding">
|
||||||
<template #default="scope">
|
<scTable
|
||||||
<el-button link type="primary" @click="table_detail(scope.row)">详情
|
ref="table"
|
||||||
</el-button>
|
:apiObj="apiObj"
|
||||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_plan.update'"
|
row-key="id"
|
||||||
v-if="scope.row.state == 10">编辑
|
stripe
|
||||||
</el-button>
|
:params="query"
|
||||||
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'pu_plan.submit'"
|
>
|
||||||
v-if="scope.row.state == 10">提交
|
<el-table-column type="index" width="50" />
|
||||||
</el-button>
|
<el-table-column
|
||||||
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_plan.delete'"
|
label="计划名称"
|
||||||
v-if="scope.row.state == 10">删除
|
prop="name"
|
||||||
</el-button>
|
show-overflow-tooltip
|
||||||
</template>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
<el-table-column label="计划编号" prop="number">
|
||||||
</el-main>
|
</el-table-column>
|
||||||
</el-container>
|
<el-table-column label="状态" prop="state">
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
|
<template #default="scope">
|
||||||
@closed="dialog.save = false"></save-dialog>
|
<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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./plan_form.vue";
|
import saveDialog from "./plan_form.vue";
|
||||||
|
import detailDialog from "./planitem.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "rparty",
|
name: "rparty",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
},
|
detailDialog,
|
||||||
data() {
|
},
|
||||||
return {
|
data() {
|
||||||
dialog: {
|
return {
|
||||||
save: false,
|
dialog: {
|
||||||
},
|
save: false,
|
||||||
apiObj: this.$API.pum.plan.list,
|
detail: false,
|
||||||
query: {
|
},
|
||||||
page: 1,
|
apiObj: this.$API.pum.plan.list,
|
||||||
page_size: 20,
|
query: {
|
||||||
type: 10
|
page: 1,
|
||||||
},
|
page_size: 20,
|
||||||
selection: [],
|
type: 10,
|
||||||
stateOption: {
|
},
|
||||||
10: { "label": "创建中", "color": "" },
|
selection: [],
|
||||||
20: { "label": "已提交", "color": "" },
|
stateOption: {
|
||||||
30: { "label": "下单中", "color": "" },
|
10: { label: "创建中", color: "" },
|
||||||
40: { "label": "下单完成", "color": "" },
|
20: { label: "已提交", color: "" },
|
||||||
40: { "label": "已完成", "color": "success" },
|
30: { label: "下单中", color: "" },
|
||||||
},
|
40: { label: "下单完成", color: "" },
|
||||||
};
|
40: { label: "已完成", color: "success" },
|
||||||
},
|
},
|
||||||
methods: {
|
planId: "",
|
||||||
//添加
|
};
|
||||||
add() {
|
},
|
||||||
this.dialog.save = true;
|
methods: {
|
||||||
this.$nextTick(() => {
|
//添加
|
||||||
this.$refs.saveDialog.open("add");
|
add() {
|
||||||
});
|
this.dialog.save = true;
|
||||||
},
|
this.$nextTick(() => {
|
||||||
//查看
|
this.$refs.saveDialog.open("add");
|
||||||
table_detail(row) {
|
});
|
||||||
this.$nextTick(() => {
|
},
|
||||||
this.$router.push({
|
//查看
|
||||||
name: "planitem",
|
table_detail(row) {
|
||||||
query: { pu_plan: row.id }
|
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_edit(row) {
|
||||||
},
|
this.dialog.save = true;
|
||||||
//查看
|
this.$nextTick(() => {
|
||||||
table_submit(row) {
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
console.log(row.id)
|
});
|
||||||
this.$API.pum.plan.submit.req(row.id).then((res) => {
|
},
|
||||||
this.$refs.table.refresh();
|
//查看
|
||||||
debugger;
|
table_submit(row) {
|
||||||
this.$message.success("提交成功");
|
this.$API.pum.plan.submit.req(row.id).then((res) => {
|
||||||
});
|
this.$refs.table.refresh();
|
||||||
},
|
this.$message.success("提交成功");
|
||||||
//删除
|
});
|
||||||
table_del(row) {
|
},
|
||||||
this.$confirm(`确定删除该计划吗?`, "提示", {
|
//删除
|
||||||
type: "warning",
|
table_del(row) {
|
||||||
}).then(() => {
|
this.$confirm(`确定删除该计划吗?`, "提示", {
|
||||||
this.$API.pum.plan.delete.req(row.id).then((res) => {
|
type: "warning",
|
||||||
this.$message.success("删除成功");
|
})
|
||||||
this.$refs.table.refresh();
|
.then(() => {
|
||||||
return res;
|
this.$API.pum.plan.delete
|
||||||
}).catch((err) => {
|
.req(row.id)
|
||||||
return err;
|
.then((res) => {
|
||||||
});
|
this.$message.success("删除成功");
|
||||||
}).catch(() => { });
|
this.$refs.table.refresh();
|
||||||
},
|
return res;
|
||||||
//本地更新数据
|
})
|
||||||
handleSaveSuccess(data, mode) {
|
.catch((err) => {
|
||||||
if (mode == "add") {
|
return err;
|
||||||
this.$refs.table.refresh();
|
});
|
||||||
} else if (mode == "edit") {
|
})
|
||||||
this.$refs.table.refresh();
|
.catch(() => {});
|
||||||
}
|
},
|
||||||
},
|
//本地更新数据
|
||||||
handleQuery() {
|
handleSaveSuccess(data, mode) {
|
||||||
this.$refs.table.queryData(this.query)
|
if (mode == "add") {
|
||||||
},
|
this.$refs.table.refresh();
|
||||||
resetQuery() {
|
} else if (mode == "edit") {
|
||||||
this.query = {};
|
this.$refs.table.refresh();
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,156 +1,221 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="padding: 8px">
|
<div style="padding: 8px">
|
||||||
<div>
|
<div>
|
||||||
<el-card style="width: 100%" header="基本信息" shadow="hover">
|
<el-card style="width: 100%" header="基本信息" shadow="hover">
|
||||||
<el-descriptions>
|
<el-descriptions>
|
||||||
<el-descriptions-item label="计划名称">{{ orderObj.name }}</el-descriptions-item>
|
<el-descriptions-item label="计划名称">{{
|
||||||
<el-descriptions-item label="计划编号">{{ orderObj.number }}</el-descriptions-item>
|
orderObj.name
|
||||||
<el-descriptions-item label="计划状态">{{ stateOption[orderObj.state] }}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
</el-descriptions>
|
<el-descriptions-item label="计划编号">{{
|
||||||
</el-card>
|
orderObj.number
|
||||||
</div>
|
}}</el-descriptions-item>
|
||||||
<div style="height:8px"></div>
|
<el-descriptions-item label="计划状态">{{
|
||||||
<div>
|
stateOption[orderObj.state]
|
||||||
<el-card style="width: 100%" header="计划明细" shadow="hover">
|
}}</el-descriptions-item>
|
||||||
<div>
|
</el-descriptions>
|
||||||
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"
|
</el-card>
|
||||||
v-if="orderObj.state == 10">新增</el-button>
|
</div>
|
||||||
</div>
|
<div style="height: 8px"></div>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination hideDo>
|
<div>
|
||||||
<el-table-column type="index" width="50" />
|
<el-card style="width: 100%" header="计划明细" shadow="hover">
|
||||||
<el-table-column label="所属物料" prop="material" show-overflow-tooltip>
|
<div>
|
||||||
<template #default="scope">
|
<el-button
|
||||||
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
|
type="primary"
|
||||||
</template>
|
icon="el-icon-plus"
|
||||||
</el-table-column>
|
v-auth="'pu_planitem.create'"
|
||||||
<el-table-column label="所属数量" prop="need_count">
|
@click="add"
|
||||||
</el-table-column>
|
v-if="orderObj.state == 10"
|
||||||
<el-table-column label="需求日期" prop="need_date" show-overflow-tooltip>
|
>新增</el-button
|
||||||
</el-table-column>
|
>
|
||||||
<el-table-column label="部门" prop="belong_dept_name">
|
</div>
|
||||||
</el-table-column>
|
<scTable
|
||||||
<el-table-column label="关联采购订单" prop="pu_order">
|
ref="table"
|
||||||
<template #default="scope">
|
:apiObj="apiObj"
|
||||||
<span v-if="scope.row.pu_order">是</span>
|
row-key="id"
|
||||||
<span v-else>否</span>
|
stripe
|
||||||
</template>
|
:params="query"
|
||||||
</el-table-column>
|
:query="query"
|
||||||
<el-table-column label="创建人" prop="create_by_name">
|
hidePagination
|
||||||
</el-table-column>
|
hideDo
|
||||||
<el-table-column label="备注" prop="note" show-overflow-tooltip>
|
>
|
||||||
</el-table-column>
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="100px">
|
<el-table-column
|
||||||
<template #default="scope">
|
label="所属物料"
|
||||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'pu_planitem.update'"
|
prop="material"
|
||||||
v-if="orderObj == 10">
|
show-overflow-tooltip
|
||||||
编辑
|
>
|
||||||
</el-button>
|
<template #default="scope">
|
||||||
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'pu_planitem.delete'"
|
<span v-if="scope.row.material_">
|
||||||
v-if="orderObj == 10">
|
{{ scope.row.material_.name }}</span
|
||||||
删除
|
>
|
||||||
</el-button>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="所属数量" prop="need_count">
|
||||||
</scTable>
|
</el-table-column>
|
||||||
</el-card>
|
<el-table-column
|
||||||
</div>
|
label="需求日期"
|
||||||
</div>
|
prop="need_date"
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" :puPlan="puPlan" @success="handleSaveSuccess"
|
show-overflow-tooltip
|
||||||
@closed="dialog.save = false"></save-dialog>
|
>
|
||||||
|
</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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./planitem_form.vue";
|
import saveDialog from "./planitem_form.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "rparty",
|
name: "rparty",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
},
|
},
|
||||||
data() {
|
props: {
|
||||||
return {
|
planId: {
|
||||||
dialog: {
|
type: String,
|
||||||
save: false,
|
default: "",
|
||||||
},
|
},
|
||||||
puPlan: '',
|
},
|
||||||
orderObj: {},
|
data() {
|
||||||
apiObj: null,
|
return {
|
||||||
query: {
|
dialog: {
|
||||||
page: 1,
|
save: false,
|
||||||
page_size: 20
|
},
|
||||||
},
|
puPlan: "",
|
||||||
stateOption: {
|
orderObj: {},
|
||||||
10: "创建中",
|
apiObj: null,
|
||||||
20: "已提交",
|
query: {
|
||||||
30: "下单中",
|
page: 1,
|
||||||
40: "下单完成",
|
page_size: 20,
|
||||||
40: "已完成",
|
pu_plan: "",
|
||||||
},
|
},
|
||||||
};
|
stateOption: {
|
||||||
},
|
10: "创建中",
|
||||||
mounted() {
|
20: "已提交",
|
||||||
this.puPlan = this.$route.query.pu_plan;
|
30: "下单中",
|
||||||
this.query.pu_plan = this.$route.query.pu_plan;
|
40: "下单完成",
|
||||||
this.apiObj = this.$API.pum.planitem.list;
|
40: "已完成",
|
||||||
this.$refs.table.refresh();
|
},
|
||||||
this.getOrder();
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
mounted() {
|
||||||
getOrder() {
|
this.puPlan = this.planId;
|
||||||
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
|
this.query.pu_plan = this.planId;
|
||||||
debugger;
|
this.apiObj = this.$API.pum.planitem.list;
|
||||||
console.log(res);
|
this.$refs.table.refresh();
|
||||||
this.orderObj = res;
|
this.getOrder();
|
||||||
})
|
},
|
||||||
},
|
methods: {
|
||||||
//添加
|
getOrder() {
|
||||||
add() {
|
this.$API.pum.plan.item.req(this.puPlan).then((res) => {
|
||||||
this.dialog.save = true;
|
this.orderObj = res;
|
||||||
this.$nextTick(() => {
|
});
|
||||||
this.$refs.saveDialog.open("add");
|
},
|
||||||
});
|
//添加
|
||||||
},
|
add() {
|
||||||
//编辑
|
this.dialog.save = true;
|
||||||
table_edit(row) {
|
this.$nextTick(() => {
|
||||||
this.dialog.save = true;
|
this.$refs.saveDialog.open("add");
|
||||||
this.$nextTick(() => {
|
});
|
||||||
this.$refs.saveDialog.open("edit").setData(row);
|
},
|
||||||
});
|
//编辑
|
||||||
},
|
table_edit(row) {
|
||||||
//查看
|
this.dialog.save = true;
|
||||||
table_show(row) {
|
this.$nextTick(() => {
|
||||||
this.dialog.save = true;
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
this.$nextTick(() => {
|
});
|
||||||
this.$refs.saveDialog.open("show").setData(row);
|
},
|
||||||
});
|
//查看
|
||||||
},
|
table_show(row) {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("show").setData(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
table_del(row) {
|
table_del(row) {
|
||||||
this.$confirm(`确定删除该计划详情吗?`, "提示", {
|
this.$confirm(`确定删除该计划详情吗?`, "提示", {
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
})
|
||||||
this.$API.pum.planitem.delete.req(row.id).then((res) => {
|
.then(() => {
|
||||||
this.$message.success("删除成功");
|
this.$API.pum.planitem.delete
|
||||||
return res;
|
.req(row.id)
|
||||||
}).catch((err) => {
|
.then((res) => {
|
||||||
return err;
|
this.$message.success("删除成功");
|
||||||
});
|
return res;
|
||||||
}).catch(() => { });
|
})
|
||||||
},
|
.catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
//本地更新数据
|
//本地更新数据
|
||||||
handleSaveSuccess(data, mode) {
|
handleSaveSuccess(data, mode) {
|
||||||
if (mode == "add") {
|
if (mode == "add") {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
} else if (mode == "edit") {
|
} else if (mode == "edit") {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query)
|
this.$refs.table.queryData(this.query);
|
||||||
},
|
},
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.query = {};
|
this.query = {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,148 +1,228 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.create'">新增</el-button>
|
<el-button
|
||||||
</div>
|
type="primary"
|
||||||
<div class="right-panel">
|
icon="el-icon-plus"
|
||||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
@click="add"
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
v-auth="'order.create'"
|
||||||
</div>
|
>新增</el-button
|
||||||
</el-header>
|
>
|
||||||
<el-main class="nopadding">
|
</div>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query">
|
<div class="right-panel">
|
||||||
<el-table-column type="index" width="50" />
|
<el-input
|
||||||
<el-table-column label="订单编号" prop="number">
|
v-model="query.search"
|
||||||
</el-table-column>
|
placeholder="名称"
|
||||||
<el-table-column label="状态" prop="state">
|
clearable
|
||||||
<template #default="scope">
|
style="margin-right: 5px"
|
||||||
{{ stateOption[scope.row.state] }}
|
></el-input>
|
||||||
</template>
|
<el-button
|
||||||
</el-table-column>
|
type="primary"
|
||||||
<el-table-column label="客户" prop="customer_name" show-overflow-tooltip>
|
icon="el-icon-search"
|
||||||
</el-table-column>
|
@click="handleQuery"
|
||||||
<el-table-column label="所属合同" prop="contract_number" show-overflow-tooltip>
|
></el-button>
|
||||||
</el-table-column>
|
</div>
|
||||||
<el-table-column label="截止到货日期" prop="delivery_date">
|
</el-header>
|
||||||
</el-table-column>
|
<el-main class="nopadding">
|
||||||
<el-table-column label="提交时间" prop="submit_time" width="160">
|
<scTable
|
||||||
</el-table-column>
|
ref="table"
|
||||||
<el-table-column label="创建人" prop="create_by_name">
|
:apiObj="apiObj"
|
||||||
</el-table-column>
|
row-key="id"
|
||||||
<el-table-column label="备注">
|
stripe
|
||||||
<template #default="scope">{{ scope.row.description }}</template>
|
:params="query"
|
||||||
</el-table-column>
|
>
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
<el-table-column type="index" width="50" />
|
||||||
<template #default="scope">
|
<el-table-column label="订单编号" prop="number">
|
||||||
<el-button link type="primary" @click="table_detail(scope.row)">
|
</el-table-column>
|
||||||
详情
|
<el-table-column label="状态" prop="state">
|
||||||
</el-button>
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="table_submit(scope.row)" v-auth="'order.update'"
|
{{ stateOption[scope.row.state] }}
|
||||||
v-if="scope.row.state == 10">
|
</template>
|
||||||
提交
|
</el-table-column>
|
||||||
</el-button>
|
<el-table-column
|
||||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'order.submit'"
|
label="客户"
|
||||||
v-if="scope.row.state == 10">
|
prop="customer_name"
|
||||||
编辑
|
show-overflow-tooltip
|
||||||
</el-button>
|
>
|
||||||
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'"
|
</el-table-column>
|
||||||
v-if="scope.row.state == 10">
|
<el-table-column
|
||||||
删除
|
label="所属合同"
|
||||||
</el-button>
|
prop="contract_number"
|
||||||
</template>
|
show-overflow-tooltip
|
||||||
</el-table-column>
|
>
|
||||||
</scTable>
|
</el-table-column>
|
||||||
</el-main>
|
<el-table-column label="截止到货日期" prop="delivery_date">
|
||||||
</el-container>
|
</el-table-column>
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess"
|
<el-table-column
|
||||||
@closed="dialog.save = false"></save-dialog>
|
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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./order_form.vue";
|
import saveDialog from "./order_form.vue";
|
||||||
|
import detailDialog from "./orderitem.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "rparty",
|
name: "rparty",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
},
|
detailDialog,
|
||||||
data() {
|
},
|
||||||
return {
|
data() {
|
||||||
dialog: {
|
return {
|
||||||
save: false,
|
dialog: {
|
||||||
},
|
save: false,
|
||||||
apiObj: this.$API.sam.order.list,
|
detail: false,
|
||||||
query: {
|
},
|
||||||
page: 1,
|
apiObj: this.$API.sam.order.list,
|
||||||
page_size: 20
|
query: {
|
||||||
},
|
page: 1,
|
||||||
selection: [],
|
page_size: 20,
|
||||||
stateOption: {
|
},
|
||||||
10: '创建中',
|
selection: [],
|
||||||
20: '已提交',
|
stateOption: {
|
||||||
30: '进行中',
|
10: "创建中",
|
||||||
40: '已交付',
|
20: "已提交",
|
||||||
},
|
30: "进行中",
|
||||||
};
|
40: "已交付",
|
||||||
},
|
},
|
||||||
methods: {
|
orderId: "",
|
||||||
//添加
|
};
|
||||||
add() {
|
},
|
||||||
this.dialog.save = true;
|
methods: {
|
||||||
this.$nextTick(() => {
|
//添加
|
||||||
this.$refs.saveDialog.open("add");
|
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_edit(row) {
|
||||||
});
|
this.dialog.save = true;
|
||||||
},
|
this.$nextTick(() => {
|
||||||
table_submit(row) {
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
this.$API.sam.order.submit.req(row.id).then((res) => {
|
});
|
||||||
this.$message.success("提交成功");
|
},
|
||||||
this.handleQuery();
|
table_submit(row) {
|
||||||
return res;
|
this.$API.sam.order.submit
|
||||||
}).catch((err) => {
|
.req(row.id)
|
||||||
return err;
|
.then((res) => {
|
||||||
});
|
this.$message.success("提交成功");
|
||||||
},
|
this.handleQuery();
|
||||||
//查看
|
return res;
|
||||||
table_detail(row) {
|
})
|
||||||
this.$router.push({
|
.catch((err) => {
|
||||||
name: "samOrderitem",
|
return err;
|
||||||
query: { order: row.id }
|
});
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
table_detail(row) {
|
||||||
|
this.orderId = row.id;
|
||||||
|
this.dialog.detail = true;
|
||||||
|
// this.$router.push({
|
||||||
|
// name: "samOrderitem",
|
||||||
|
// query: { order: row.id }
|
||||||
|
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
//删除
|
//删除
|
||||||
async table_del(row) {
|
async table_del(row) {
|
||||||
this.$confirm(`确定删除吗?`, "提示", {
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
})
|
||||||
this.$API.sam.order.delete.req(row.id).then((res) => {
|
.then(() => {
|
||||||
this.$message.success("删除成功");
|
this.$API.sam.order.delete
|
||||||
return res;
|
.req(row.id)
|
||||||
}).catch((err) => {
|
.then((res) => {
|
||||||
return err;
|
this.$message.success("删除成功");
|
||||||
});
|
return res;
|
||||||
}).catch(() => { });
|
})
|
||||||
},
|
.catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
//本地更新数据
|
//本地更新数据
|
||||||
handleSaveSuccess(data, mode) {
|
handleSaveSuccess(data, mode) {
|
||||||
if (mode == "add") {
|
if (mode == "add") {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
} else if (mode == "edit") {
|
} else if (mode == "edit") {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query)
|
this.$refs.table.queryData(this.query);
|
||||||
},
|
},
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.query = {};
|
this.query = {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,142 +1,199 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="padding: 8px">
|
<div style="padding: 8px">
|
||||||
<div>
|
<div>
|
||||||
<el-card style="width: 100%" header="基本信息" shadow="hover">
|
<el-card style="width: 100%" header="基本信息" shadow="hover">
|
||||||
<el-descriptions>
|
<el-descriptions>
|
||||||
<el-descriptions-item label="订单编号">{{ orderObj.number }}</el-descriptions-item>
|
<el-descriptions-item label="订单编号">{{
|
||||||
<el-descriptions-item label="客户">{{ orderObj.customer_name }}</el-descriptions-item>
|
orderObj.number
|
||||||
<el-descriptions-item label="订单状态">{{ orderObj.state }}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="截止交货">{{ orderObj.delivery_date }}</el-descriptions-item>
|
<el-descriptions-item label="客户">{{
|
||||||
</el-descriptions>
|
orderObj.customer_name
|
||||||
</el-card>
|
}}</el-descriptions-item>
|
||||||
</div>
|
<el-descriptions-item label="订单状态">{{
|
||||||
<div style="height:8px"></div>
|
orderObj.state
|
||||||
<div>
|
}}</el-descriptions-item>
|
||||||
<el-card style="width: 100%" header="订单明细" shadow="hover">
|
<el-descriptions-item label="截止交货">{{
|
||||||
<div>
|
orderObj.delivery_date
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'order.update'"></el-button>
|
}}</el-descriptions-item>
|
||||||
</div>
|
</el-descriptions>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params" hidePagination>
|
</el-card>
|
||||||
<el-table-column type="index" width="50" />
|
</div>
|
||||||
<el-table-column label="所需产品" prop="material" show-overflow-tooltip>
|
<div style="height: 8px"></div>
|
||||||
<template #default="scope">
|
<div>
|
||||||
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
|
<el-card style="width: 100%" header="订单明细" shadow="hover">
|
||||||
</template>
|
<div>
|
||||||
</el-table-column>
|
<el-button
|
||||||
<!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip>
|
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">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.order_"> {{ scope.row.order_.name }}</span>
|
<span v-if="scope.row.order_"> {{ scope.row.order_.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="所需数量" prop="count">
|
<el-table-column label="所需数量" prop="count">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="已交货数量" prop="delivered_count">
|
<el-table-column label="已交货数量" prop="delivered_count">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip>
|
<el-table-column
|
||||||
</el-table-column>
|
label="创建时间"
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="100px">
|
prop="create_time"
|
||||||
<template #default="scope">
|
show-overflow-tooltip
|
||||||
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'order.update'">
|
>
|
||||||
编辑
|
</el-table-column>
|
||||||
</el-link>
|
<el-table-column
|
||||||
<el-divider direction="vertical"></el-divider>
|
label="操作"
|
||||||
<el-link type="danger" @click="table_del(scope.row)" v-auth="'order.delete'">
|
fixed="right"
|
||||||
删除
|
align="center"
|
||||||
</el-link>
|
width="100px"
|
||||||
</template>
|
>
|
||||||
</el-table-column>
|
<template #default="scope">
|
||||||
</scTable>
|
<el-link
|
||||||
</el-card>
|
type="primary"
|
||||||
</div>
|
@click="table_edit(scope.row)"
|
||||||
</div>
|
v-auth="'order.update'"
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" :orderId="orderId" @success="handleSaveSuccess"
|
>
|
||||||
@closed="dialog.save = false"></save-dialog>
|
编辑
|
||||||
|
</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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./orderitem_form.vue";
|
import saveDialog from "./orderitem_form.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "rparty",
|
name: "rparty",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
},
|
},
|
||||||
data() {
|
props: {
|
||||||
return {
|
orderId: {
|
||||||
dialog: {
|
type: String,
|
||||||
save: false,
|
default: "",
|
||||||
},
|
},
|
||||||
apiObj: null,
|
},
|
||||||
params: {},
|
data() {
|
||||||
orderId: '',
|
return {
|
||||||
orderObj: {},
|
dialog: {
|
||||||
selection: [],
|
save: false,
|
||||||
state_: {
|
},
|
||||||
10: '完好',
|
apiObj: null,
|
||||||
20: '限用',
|
params: {},
|
||||||
30: '在修',
|
orderObj: {},
|
||||||
40: '禁用',
|
selection: [],
|
||||||
},
|
state_: {
|
||||||
};
|
10: "完好",
|
||||||
},
|
20: "限用",
|
||||||
mounted() {
|
30: "在修",
|
||||||
this.orderId = this.$route.query.order;
|
40: "禁用",
|
||||||
this.params.order = this.$route.query.order;
|
},
|
||||||
this.apiObj = this.$API.sam.orderitem.list;
|
};
|
||||||
this.getOrder();
|
},
|
||||||
},
|
mounted() {
|
||||||
methods: {
|
this.params.order = this.orderId;
|
||||||
getOrder() {
|
this.apiObj = this.$API.sam.orderitem.list;
|
||||||
this.$API.sam.order.item.req(this.orderId).then((res) => {
|
this.getOrder();
|
||||||
this.orderObj = res;
|
},
|
||||||
})
|
methods: {
|
||||||
},
|
getOrder() {
|
||||||
//添加
|
this.$API.sam.order.item.req(this.orderId).then((res) => {
|
||||||
table_add() {
|
this.orderObj = res;
|
||||||
this.dialog.save = true;
|
});
|
||||||
this.$nextTick(() => {
|
},
|
||||||
this.$refs.saveDialog.open("add");
|
//添加
|
||||||
});
|
table_add() {
|
||||||
},
|
this.dialog.save = true;
|
||||||
//编辑
|
this.$nextTick(() => {
|
||||||
table_edit(row) {
|
this.$refs.saveDialog.open("add");
|
||||||
this.dialog.save = true;
|
});
|
||||||
this.$nextTick(() => {
|
},
|
||||||
this.$refs.saveDialog.open("edit").setData(row);
|
//编辑
|
||||||
});
|
table_edit(row) {
|
||||||
},
|
this.dialog.save = true;
|
||||||
//查看
|
this.$nextTick(() => {
|
||||||
table_show(row) {
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
this.dialog.save = true;
|
});
|
||||||
this.$nextTick(() => {
|
},
|
||||||
this.$refs.saveDialog.open("show").setData(row);
|
//查看
|
||||||
});
|
table_show(row) {
|
||||||
},
|
this.dialog.save = true;
|
||||||
//删除
|
this.$nextTick(() => {
|
||||||
table_del(row) {
|
this.$refs.saveDialog.open("show").setData(row);
|
||||||
this.$confirm(`确定删除吗?`, "提示", {
|
});
|
||||||
type: "warning",
|
},
|
||||||
}).then(() => {
|
//删除
|
||||||
this.$API.sam.orderitem.delete.req(row.id).then((res) => {
|
table_del(row) {
|
||||||
this.$message.success("删除成功");
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
return res;
|
type: "warning",
|
||||||
}).catch((err) => {
|
})
|
||||||
return err;
|
.then(() => {
|
||||||
});
|
this.$API.sam.orderitem.delete
|
||||||
}).catch(() => { });
|
.req(row.id)
|
||||||
},
|
.then((res) => {
|
||||||
//本地更新数据
|
this.$message.success("删除成功");
|
||||||
handleSaveSuccess(data, mode) {
|
return res;
|
||||||
if (mode == "add") {
|
})
|
||||||
this.$refs.table.refresh();
|
.catch((err) => {
|
||||||
} else if (mode == "edit") {
|
return err;
|
||||||
this.$refs.table.refresh();
|
});
|
||||||
}
|
})
|
||||||
},
|
.catch(() => {});
|
||||||
handleQuery() {
|
},
|
||||||
this.$refs.table.queryData(this.query)
|
//本地更新数据
|
||||||
},
|
handleSaveSuccess(data, mode) {
|
||||||
resetQuery() {
|
if (mode == "add") {
|
||||||
this.query = {};
|
this.$refs.table.refresh();
|
||||||
},
|
} else if (mode == "edit") {
|
||||||
},
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue