|
@@ -130,12 +130,12 @@ export default {
|
|
|
first: [],
|
|
|
second: [],
|
|
|
},
|
|
|
- detailsData: {}
|
|
|
+ checkedData: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
showSearchColumns() {
|
|
|
- console.log(this.searchColumns,'this.searchColumns');
|
|
|
+ console.log(this.searchColumns, 'this.searchColumns');
|
|
|
return this.isSimpleSearch
|
|
|
? this.searchColumns.slice(0, 4)
|
|
|
: this.searchColumns;
|
|
@@ -150,16 +150,18 @@ export default {
|
|
|
// },
|
|
|
// },
|
|
|
created() {
|
|
|
- this.fetchTaskList();
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
console.log("Vue", this);
|
|
|
},
|
|
|
methods: {
|
|
|
- async fetchTaskList() {
|
|
|
- this.loading = true;
|
|
|
+ async fetchList(params, page) {
|
|
|
try {
|
|
|
- const { code, msg, rows, total } = await orderApi.orderList({
|
|
|
- ...this.page,
|
|
|
- ...this.searchParams,
|
|
|
+ this.loading = true;
|
|
|
+ const { pageNum, pageSize } = page;
|
|
|
+ const { code, msg, rows, total } = await orderApi.list({
|
|
|
+ pageNum,
|
|
|
+ pageSize,
|
|
|
+ ...params,
|
|
|
});
|
|
|
if (code === 200) {
|
|
|
this.page.total = total;
|
|
@@ -180,38 +182,57 @@ export default {
|
|
|
title: this.isSimpleSearch ? "Simple Search" : "All Search",
|
|
|
});
|
|
|
},
|
|
|
- handleSizeChange() { },
|
|
|
- handleCurrentChange() { },
|
|
|
+ // 页大小变
|
|
|
+ handleSizeChange(prop) {
|
|
|
+ this.page.pageSize = prop;
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
+ },
|
|
|
+ // 当前页变
|
|
|
+ handleCurrentChange(prop) {
|
|
|
+ this.page.pageNum = prop;
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
+ },
|
|
|
+ // 刷新操作
|
|
|
+ handleRefreshList() {
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
+ },
|
|
|
+ // 查询操作
|
|
|
+ handleQueryList() {
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
+ },
|
|
|
+ // 重置操作
|
|
|
+ handleResetList() {
|
|
|
+ this.page = initPage();
|
|
|
+ this.params = initParams();
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
+ },
|
|
|
handleTabClick() { },
|
|
|
+ // 新增
|
|
|
handleOpenAddDrawer() {
|
|
|
const { setVisible } = this.$refs.addDrawerFef;
|
|
|
setVisible(true);
|
|
|
- setTimeout(() => {
|
|
|
- this.$notify.info("Open Add Drawer");
|
|
|
- }, 250);
|
|
|
},
|
|
|
- handleOpenSeeDrawer() {
|
|
|
- const { setVisible ,setParams} = this.$refs.seeDrawerFef;
|
|
|
- setVisible(true);
|
|
|
- setTimeout(() => {
|
|
|
- setParams( this.detailsData)
|
|
|
- this.$notify.info("Open See Drawer");
|
|
|
- }, 250);
|
|
|
+ // 查看
|
|
|
+ async handleOpenSeeDrawer(row) {
|
|
|
+ const { id } = row;
|
|
|
+ const { setVisible, fetchItem } = this.$refs.seeDrawerFef;
|
|
|
+ await setVisible(true);
|
|
|
+ await fetchItem(id);
|
|
|
},
|
|
|
- handleOpenEditDrawer() {
|
|
|
- const { setVisible } = this.$refs.editDrawerFef;
|
|
|
- setVisible(true);
|
|
|
- setTimeout(() => {
|
|
|
- this.$notify.info("Open Edit Drawer");
|
|
|
- }, 250);
|
|
|
+ // 编辑、修订
|
|
|
+ async handleOpenEditDrawer(row) {
|
|
|
+ const { id } = row;
|
|
|
+ const { setVisible, fetchItem } = this.$refs.editDrawerFef;
|
|
|
+ await setVisible(true);
|
|
|
+ await fetchItem(id);
|
|
|
},
|
|
|
// 获取子表信息
|
|
|
async handleDetailsData(row) {
|
|
|
console.log(row, '获取详情信息');
|
|
|
try {
|
|
|
- const { code, msg, data } = await orderApi.orderDetails(row.id);
|
|
|
+ const { code, msg, data } = await orderApi.details(row.id);
|
|
|
if (code === 200) {
|
|
|
- this.detailsData = data;
|
|
|
+ this.checkedData = data;
|
|
|
// 物料信息:puOrderItemList 执行结果:puOrderExecuteList
|
|
|
this.tabTableDatas.first = data.puOrderItemList;
|
|
|
this.tabTableDatas.second = data.puOrderExecuteList;
|
|
@@ -225,12 +246,26 @@ export default {
|
|
|
// this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
- // 重置操作
|
|
|
- handleResetList() {
|
|
|
- this.page = initPage();
|
|
|
- this.params = initParams();
|
|
|
- this.fetchList(this.params, this.page);
|
|
|
+ // 删除操作
|
|
|
+ async handleDeleteList(prop) {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const { id } = prop;
|
|
|
+ console.log(id, 'id');
|
|
|
+ // const { code, msg } = await remove(id);
|
|
|
+ // if (code === 200) {
|
|
|
+ // this.$notify.success({ title: msg });
|
|
|
+ // this.fetchList(this.params, this.page);
|
|
|
+ // } else {
|
|
|
+ // this.$notify.warning({ title: msg });
|
|
|
+ // }
|
|
|
+ } catch (err) {
|
|
|
+ this.$notify.error({ title: "error", message: err });
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -252,8 +287,8 @@ export default {
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
- <el-col :span="3" :offset="1" style="text-align: right; padding-right: 40px">
|
|
|
- <el-button type="primary" size="mini">搜索</el-button>
|
|
|
+ <el-col :span="4" style="text-align: right; padding-right: 40px">
|
|
|
+ <el-button type="primary" size="mini" @click="handleQueryList">搜索</el-button>
|
|
|
<el-button size="mini" @click="handleResetList">重置</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -275,7 +310,7 @@ export default {
|
|
|
</el-button-group>
|
|
|
|
|
|
<el-button-group style="margin-left: 10px">
|
|
|
- <el-button size="mini">修订</el-button>
|
|
|
+ <!-- <el-button size="mini" :disabled="checkedData.status != '2'">修订</el-button> -->
|
|
|
<el-button size="mini">退回</el-button>
|
|
|
</el-button-group>
|
|
|
|
|
@@ -296,9 +331,10 @@ export default {
|
|
|
</el-table-column>
|
|
|
<el-table-column fixed="right" label="操作" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button>
|
|
|
- <el-button type="text" size="small" @click="handleOpenEditDrawer(scope.row)">编辑</el-button>
|
|
|
- <el-button type="text" size="small">删除</el-button>
|
|
|
+ <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button>
|
|
|
+ <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
|
|
|
+ {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
|
|
|
+ <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|