|
@@ -1,22 +1,18 @@
|
|
|
el-col
|
|
|
<script>
|
|
|
import { TableColumns, SearchColumns } from "./column";
|
|
|
-import { LIST, SHUTDOWN } from "@/api/business/purchase/task";
|
|
|
-import {
|
|
|
- initPage,
|
|
|
- initDicts,
|
|
|
- initLayout,
|
|
|
- initParams,
|
|
|
- initPageSizes,
|
|
|
-} from "@/utils/init";
|
|
|
+import { LIST } from "@/api/business/purchase/task";
|
|
|
+import { initPage, initDicts, initParams } from "@/utils/init";
|
|
|
export default {
|
|
|
name: "PuchaseTask",
|
|
|
dicts: [...initDicts(TableColumns), ...initDicts(SearchColumns)],
|
|
|
components: {
|
|
|
- SeeDialog: () => import("./see/index.vue"),
|
|
|
- FirstDirectDialog: () => import("./first-direct/index.vue"),
|
|
|
- DocReturnDialog: () => import("./documents-return/index.vue"),
|
|
|
- ModifyBuyerDialog: () => import("./modify-buyer/index.vue"),
|
|
|
+ SeeModel: () => import("./see/index.vue"),
|
|
|
+ CloseModel: () => import("./close/index.vue"),
|
|
|
+ ExportModel: () => import("./export/index.vue"),
|
|
|
+ ShiftModel: () => import("./modify-buyer/index.vue"),
|
|
|
+ DirectModel: () => import("./first-direct/index.vue"),
|
|
|
+ ReturnModel: () => import("./documents-return/index.vue"),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -33,7 +29,7 @@ export default {
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
created() {
|
|
|
- this.queryList(this.params, this.page);
|
|
|
+ this.useQuery(this.params, this.page);
|
|
|
},
|
|
|
methods: {
|
|
|
//
|
|
@@ -41,98 +37,83 @@ export default {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
const { pageNum, pageSize } = page;
|
|
|
- const { code, msg, rows, total } = await LIST(
|
|
|
+ const { code,rows, total } = await LIST(
|
|
|
{ ...prop },
|
|
|
- { pageNum, pageSize, isAsc: "desc", orderByColumn: "createTime" }
|
|
|
+ { pageNum, pageSize }
|
|
|
);
|
|
|
if (code === 200) {
|
|
|
this.tableData = rows;
|
|
|
this.page.total = total;
|
|
|
- this.$notify.success({ title: msg });
|
|
|
+
|
|
|
} else {
|
|
|
this.$notify.warning({ title: msg });
|
|
|
}
|
|
|
} catch (err) {
|
|
|
- //
|
|
|
+ // catch
|
|
|
} finally {
|
|
|
+ // finally
|
|
|
this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
- // 查询操作
|
|
|
- queryList(prop, page) {
|
|
|
- const { date } = prop;
|
|
|
+ // 查 询
|
|
|
+ useQuery(prop, page) {
|
|
|
+ const { date, documentsCodes } = prop;
|
|
|
prop.endDate = date[1];
|
|
|
prop.startDate = date[0];
|
|
|
- this.fetchList({ ...prop, date: undefined }, page);
|
|
|
+ prop.documentsCodes = documentsCodes
|
|
|
+ ? documentsCodes.split(",")
|
|
|
+ : undefined;
|
|
|
+ this.fetchList(
|
|
|
+ {
|
|
|
+ ...prop,
|
|
|
+ isAsc: "desc",
|
|
|
+ date: undefined,
|
|
|
+ orderByColumn: "createTime",
|
|
|
+ },
|
|
|
+ page
|
|
|
+ );
|
|
|
},
|
|
|
- // 重置操作
|
|
|
- resetList() {
|
|
|
+ // 重 置
|
|
|
+ useReset() {
|
|
|
this.page = initPage();
|
|
|
this.params = initParams(SearchColumns);
|
|
|
- this.queryList(this.params, this.page);
|
|
|
- },
|
|
|
- // 页大小变
|
|
|
- sizeChange(prop) {
|
|
|
- this.page.pageSize = prop;
|
|
|
- this.queryList(this.params, this.page);
|
|
|
+ this.useQuery(this.params, this.page);
|
|
|
},
|
|
|
- // 当前页变
|
|
|
- currentChange(prop) {
|
|
|
- this.page.pageNum = prop;
|
|
|
- this.queryList(this.params, this.page);
|
|
|
- },
|
|
|
- // 选择行
|
|
|
- selectionChange(prop) {
|
|
|
+ // 选 择
|
|
|
+ useSelect(prop) {
|
|
|
this.selectData = prop;
|
|
|
},
|
|
|
- // 行关闭
|
|
|
- async shutDown(prop) {
|
|
|
- try {
|
|
|
- this.loading = true;
|
|
|
- const { demandItemId } = prop;
|
|
|
- const { code, msg } = await SHUTDOWN(demandItemId);
|
|
|
- if (code === 200) {
|
|
|
- this.$notify.success({ title: msg });
|
|
|
- await this.queryList(this.params, this.page);
|
|
|
- } else {
|
|
|
- this.$notify.warning({ title: msg });
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- //
|
|
|
- } finally {
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
+ // 行 关
|
|
|
+ async useClose(prop) {
|
|
|
+ const { open } = this.$refs.CloseModel;
|
|
|
+ await open(prop);
|
|
|
},
|
|
|
- // 退回需求
|
|
|
- async openDocumentsReturnDialog(prop) {
|
|
|
- const { open } = this.$refs.DocReturnDialog;
|
|
|
+ // 退 回
|
|
|
+ async useReturn(prop) {
|
|
|
+ const { open } = this.$refs.ReturnModel;
|
|
|
await open(prop);
|
|
|
},
|
|
|
- // 转派
|
|
|
- async openModifyBuyerDialog(prop) {
|
|
|
+ // 转 派
|
|
|
+ async useShift(prop) {
|
|
|
const { id } = prop;
|
|
|
- const { open } = this.$refs.ModifyBuyerDialog;
|
|
|
+ const { open } = this.$refs.ShiftModTel;
|
|
|
await open(id);
|
|
|
},
|
|
|
- // 打开查看drawer
|
|
|
- async openSeeDialog(prop) {
|
|
|
+ // 明 细
|
|
|
+ async useSee(prop) {
|
|
|
const { id } = prop;
|
|
|
- const { open } = this.$refs.SeeDialog;
|
|
|
+ const { open } = this.$refs.SeeModel;
|
|
|
await open(id);
|
|
|
},
|
|
|
- // 打开首次直采drawer
|
|
|
- async openFristDirectDialog(prop) {
|
|
|
- const { open } = this.$refs.FirstDirectDialog;
|
|
|
+ // 直 采
|
|
|
+ async useDirect(prop) {
|
|
|
+ const { open } = this.$refs.DirectModel;
|
|
|
await open(prop);
|
|
|
},
|
|
|
- // 导出
|
|
|
+ // 导 出
|
|
|
async useExport(prop, page) {
|
|
|
- const { pageNum, pageSize } = page;
|
|
|
- this.download(
|
|
|
- "pu/order/generate/export",
|
|
|
- { ...prop, pageNum, pageSize },
|
|
|
- `KONG_${new Date().getTime()}.xlsx`
|
|
|
- );
|
|
|
+ const { open } = this.$refs.ExportModel;
|
|
|
+ await open(prop, page);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -149,19 +130,12 @@ export default {
|
|
|
"
|
|
|
:body-style="{ padding: 0 }"
|
|
|
>
|
|
|
- <see-dialog ref="SeeDialog"></see-dialog>
|
|
|
- <first-direct-dialog
|
|
|
- ref="FirstDirectDialog"
|
|
|
- @success="resetList"
|
|
|
- ></first-direct-dialog>
|
|
|
- <doc-return-dialog
|
|
|
- ref="DocReturnDialog"
|
|
|
- @success="resetList"
|
|
|
- ></doc-return-dialog>
|
|
|
- <modify-buyer-dialog
|
|
|
- ref="ModifyBuyerDialog"
|
|
|
- @success="resetList"
|
|
|
- ></modify-buyer-dialog>
|
|
|
+ <see-model ref="SeeModel"></see-model>
|
|
|
+ <export-model ref="ExportModel"></export-model>
|
|
|
+ <close-model ref="CloseModel" @success="useReset"></close-model>
|
|
|
+ <shift-model ref="ShiftModel" @success="useReset"></shift-model>
|
|
|
+ <direct-model ref="DirectModel" @success="useReset"></direct-model>
|
|
|
+ <return-model ref="ReturnModel" @success="useReset"></return-model>
|
|
|
<el-backtop target=".el-scrollbar__wrap"></el-backtop>
|
|
|
<el-form
|
|
|
:size="size"
|
|
@@ -185,6 +159,7 @@ export default {
|
|
|
:clearable="column.clearable"
|
|
|
:placeholder="column.placeholder"
|
|
|
style="width: 100%"
|
|
|
+ @keyup.enter.native="useQuery(params, page)"
|
|
|
></el-input>
|
|
|
<el-select
|
|
|
v-if="column.inputType === 'Select'"
|
|
@@ -193,6 +168,7 @@ export default {
|
|
|
:clearable="column.clearable"
|
|
|
:placeholder="column.placeholder"
|
|
|
style="width: 100%"
|
|
|
+ @keyup.enter.native="useQuery(params, page)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dict.type[column.referName]"
|
|
@@ -214,6 +190,7 @@ export default {
|
|
|
:end-placeholder="column.endPlaceholder"
|
|
|
:start-placeholder="column.startPlaceholder"
|
|
|
style="width: 100%"
|
|
|
+ @keyup.enter.native="useQuery(params, page)"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
<dr-popover-select
|
|
@@ -229,6 +206,7 @@ export default {
|
|
|
:placeholder="column.placeholder"
|
|
|
:data-mapping="column.dataMapping"
|
|
|
:query-params="column.queryParams(params)"
|
|
|
+ @keyup.enter.native="useQuery(params, page)"
|
|
|
>
|
|
|
</dr-popover-select>
|
|
|
<dr-popover-tree-select
|
|
@@ -247,65 +225,51 @@ export default {
|
|
|
</dr-popover-tree-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label-width="0">
|
|
|
- <el-button
|
|
|
- circle
|
|
|
- :size="size"
|
|
|
- icon="el-icon-search"
|
|
|
- @click="queryList(params, page)"
|
|
|
- ></el-button>
|
|
|
- <el-button
|
|
|
- circle
|
|
|
- :size="size"
|
|
|
- icon="el-icon-refresh"
|
|
|
- @click="resetList"
|
|
|
- ></el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <el-row :gutter="24" style="padding: 0 20px">
|
|
|
- <el-col :span="24">
|
|
|
- <el-button :size="size" @click="useExport(params, page)">
|
|
|
- 导 出
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- :size="size"
|
|
|
- :disabled="selectData.length !== 1"
|
|
|
- @click="openModifyBuyerDialog(selectData[0])"
|
|
|
- >
|
|
|
- 转 派
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- :size="size"
|
|
|
- :disabled="!selectData.length"
|
|
|
- @click="openDocumentsReturnDialog(selectData)"
|
|
|
- >
|
|
|
- 退回需求
|
|
|
- </el-button>
|
|
|
- <!-- <el-button
|
|
|
+ <el-row style="padding: 0 20px">
|
|
|
+ <el-button :size="size" @click="useQuery(params, page)">
|
|
|
+ 查 询
|
|
|
+ </el-button>
|
|
|
+ <el-button :size="size" @click="useReset"> 重 置 </el-button>
|
|
|
+ <!-- <el-button :size="size" @click="useExport(params, page)">
|
|
|
+ 导 出
|
|
|
+ </el-button> -->
|
|
|
+ <el-button
|
|
|
+ :size="size"
|
|
|
+ :disabled="selectData.length !== 1"
|
|
|
+ @click="useShift(selectData[0])"
|
|
|
+ >
|
|
|
+ 转 派
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ :size="size"
|
|
|
+ :disabled="!selectData.length"
|
|
|
+ @click="useReturn(selectData)"
|
|
|
+ >
|
|
|
+ 退回需求
|
|
|
+ </el-button>
|
|
|
+ <!-- <el-button
|
|
|
:size="size"
|
|
|
:disabled="selectData.length !== 1"
|
|
|
- @click="shutDown(selectData[0])"
|
|
|
+ @click="useClose(selectData[0])"
|
|
|
>
|
|
|
行关闭
|
|
|
</el-button> -->
|
|
|
- <el-button
|
|
|
- :size="size"
|
|
|
- :disabled="!selectData.length"
|
|
|
- @click="openFristDirectDialog(selectData)"
|
|
|
- >
|
|
|
- 协议直采
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
+ <el-button
|
|
|
+ :size="size"
|
|
|
+ :disabled="!selectData.length"
|
|
|
+ @click="useDirect(selectData)"
|
|
|
+ >
|
|
|
+ 协议直采
|
|
|
+ </el-button>
|
|
|
</el-row>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
size="mini"
|
|
|
style="width: 100%; margin: 20px 0 0 0"
|
|
|
- @row-dblclick="openSeeDialog"
|
|
|
- @selection-change="selectionChange"
|
|
|
+ @row-dblclick="useSee"
|
|
|
+ @selection-change="useSelect"
|
|
|
>
|
|
|
<el-table-column fixed width="55" align="center" type="selection">
|
|
|
</el-table-column>
|
|
@@ -332,7 +296,7 @@ export default {
|
|
|
:total="page.total"
|
|
|
:page.sync="page.pageNum"
|
|
|
:limit.sync="page.pageSize"
|
|
|
- @pagination="queryList(params, page)"
|
|
|
+ @pagination="useQuery(params, page)"
|
|
|
/>
|
|
|
</el-card>
|
|
|
</template>
|