|
@@ -1,16 +1,17 @@
|
|
|
+el-col
|
|
|
<script>
|
|
|
import { TableColumns, SearchColumns } from "./column";
|
|
|
-import { LIST, SHUTDOWN, EXPORT } from "@/api/business/purchase/task";
|
|
|
+import { LIST, SHUTDOWN } from "@/api/business/purchase/task";
|
|
|
import {
|
|
|
initPage,
|
|
|
+ initDicts,
|
|
|
initLayout,
|
|
|
- initPageSizes,
|
|
|
initParams,
|
|
|
- initDicts,
|
|
|
+ initPageSizes,
|
|
|
} from "@/utils/init";
|
|
|
export default {
|
|
|
name: "PuchaseTask",
|
|
|
- dicts: initDicts(TableColumns),
|
|
|
+ dicts: [...initDicts(TableColumns), ...initDicts(SearchColumns)],
|
|
|
components: {
|
|
|
SeeDialog: () => import("./see/index.vue"),
|
|
|
FirstDirectDialog: () => import("./first-direct/index.vue"),
|
|
@@ -20,16 +21,12 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
size: "mini",
|
|
|
-
|
|
|
loading: false,
|
|
|
-
|
|
|
searchColumns: SearchColumns,
|
|
|
params: initParams(SearchColumns),
|
|
|
-
|
|
|
tableData: [],
|
|
|
selectData: [],
|
|
|
tableColumns: TableColumns,
|
|
|
-
|
|
|
page: initPage(),
|
|
|
layout: initLayout(),
|
|
|
pageSizes: initPageSizes(),
|
|
@@ -38,7 +35,7 @@ export default {
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
created() {
|
|
|
- this.handleQueryList(this.params, this.page);
|
|
|
+ this.queryList(this.params, this.page);
|
|
|
},
|
|
|
methods: {
|
|
|
//
|
|
@@ -64,41 +61,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 查询操作
|
|
|
- handleQueryList(prop, page) {
|
|
|
+ queryList(prop, page) {
|
|
|
const { date } = prop;
|
|
|
prop.endDate = date[1];
|
|
|
prop.startDate = date[0];
|
|
|
this.fetchList({ ...prop, date: undefined }, page);
|
|
|
},
|
|
|
// 重置操作
|
|
|
- handleResetList() {
|
|
|
+ resetList() {
|
|
|
this.page = initPage();
|
|
|
this.params = initParams(SearchColumns);
|
|
|
- this.handleQueryList(this.params, this.page);
|
|
|
+ this.queryList(this.params, this.page);
|
|
|
},
|
|
|
// 页大小变
|
|
|
- handleSizeChange(prop) {
|
|
|
+ sizeChange(prop) {
|
|
|
this.page.pageSize = prop;
|
|
|
- this.handleQueryList(this.params, this.page);
|
|
|
+ this.queryList(this.params, this.page);
|
|
|
},
|
|
|
// 当前页变
|
|
|
- handleCurrentChange(prop) {
|
|
|
+ currentChange(prop) {
|
|
|
this.page.pageNum = prop;
|
|
|
- this.handleQueryList(this.params, this.page);
|
|
|
+ this.queryList(this.params, this.page);
|
|
|
},
|
|
|
// 选择行
|
|
|
- handleSelectionChange(prop) {
|
|
|
+ selectionChange(prop) {
|
|
|
this.selectData = prop;
|
|
|
},
|
|
|
// 行关闭
|
|
|
- async handleShutDown(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.handleQueryList(this.params, this.page);
|
|
|
+ await this.queryList(this.params, this.page);
|
|
|
} else {
|
|
|
this.$notify.warning({ title: msg });
|
|
|
}
|
|
@@ -109,20 +106,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 退回需求
|
|
|
- async handleDocumentsReturn(prop) {
|
|
|
+ async openDocumentsReturnDialog(prop) {
|
|
|
const { setVisible, beforeOpenDoSome } = this.$refs.DocReturnDialog;
|
|
|
await setVisible(true);
|
|
|
await beforeOpenDoSome(prop);
|
|
|
},
|
|
|
// 转派
|
|
|
- async handleModifyBuyer(prop) {
|
|
|
+ async openModifyBuyerDialog(prop) {
|
|
|
const { id } = prop;
|
|
|
const { setVisible, beforeOpenDoSome } = this.$refs.ModifyBuyerDialog;
|
|
|
await setVisible(true);
|
|
|
await beforeOpenDoSome(id);
|
|
|
},
|
|
|
// 导出
|
|
|
- async handleExport(prop, page) {
|
|
|
+ async useExport(prop, page) {
|
|
|
const { pageNum, pageSize } = page;
|
|
|
this.download(
|
|
|
"pu/order/generate/export",
|
|
@@ -131,17 +128,15 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
// 打开查看drawer
|
|
|
- async handleOpenSeeDrawer(prop) {
|
|
|
+ async openSeeDialog(prop) {
|
|
|
const { id } = prop;
|
|
|
- const { setVisible, beforeOpenDoSome } = this.$refs.SeeDialog;
|
|
|
- await setVisible(true);
|
|
|
- await beforeOpenDoSome(id);
|
|
|
+ const { open } = this.$refs.SeeDialog;
|
|
|
+ await open(id);
|
|
|
},
|
|
|
// 打开首次直采drawer
|
|
|
- async handleOpenFristDirectDrawer(prop) {
|
|
|
- const { setVisible, beforeOpenDoSome } = this.$refs.FirstDirectDialog;
|
|
|
- await setVisible(true);
|
|
|
- await beforeOpenDoSome(prop);
|
|
|
+ async openFristDirectDialog(prop) {
|
|
|
+ const { open } = this.$refs.FirstDirectDialog;
|
|
|
+ await open(prop);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -159,131 +154,135 @@ export default {
|
|
|
<modify-buyer-dialog ref="ModifyBuyerDialog"></modify-buyer-dialog>
|
|
|
<el-form
|
|
|
:size="size"
|
|
|
- :inline="true"
|
|
|
:model="params"
|
|
|
- label-width="75px"
|
|
|
+ label-width="auto"
|
|
|
label-position="right"
|
|
|
style="padding: 20px 20px 0"
|
|
|
>
|
|
|
- <el-form-item
|
|
|
- v-for="column in searchColumns"
|
|
|
- :key="column.title"
|
|
|
- :prop="column.key"
|
|
|
- :label="column.title"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-if="column.inputType === 'Input'"
|
|
|
- v-model="params[column.key]"
|
|
|
- :disabled="column.disabled"
|
|
|
- :clearable="column.clearable"
|
|
|
- :placeholder="column.placeholder"
|
|
|
- style="width: 100%"
|
|
|
- ></el-input>
|
|
|
- <el-select
|
|
|
- v-if="column.inputType === 'Select'"
|
|
|
- v-model="params[column.key]"
|
|
|
- :disabled="column.disabled"
|
|
|
- :clearable="column.clearable"
|
|
|
- :placeholder="column.placeholder"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dict.type[column.referName]"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-date-picker
|
|
|
- v-if="column.inputType === 'DatePicker'"
|
|
|
- v-model="params[column.key]"
|
|
|
- :type="column.type"
|
|
|
- :placeholder="column.placeholder"
|
|
|
- :value-format="column.valueFormat"
|
|
|
- :unlink-panels="column.unlinkPanels"
|
|
|
- :picker-options="column.pickerOptions"
|
|
|
- :range-separator="column.rangeSeparator"
|
|
|
- :end-placeholder="column.endPlaceholder"
|
|
|
- :start-placeholder="column.startPlaceholder"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- <dr-popover-select
|
|
|
- v-if="column.inputType === 'PopoverSelect'"
|
|
|
- v-model="params[column.key]"
|
|
|
- :size="size"
|
|
|
- :source.sync="params"
|
|
|
- :title="column.title"
|
|
|
- :type="column.referName"
|
|
|
- :multiple="column.multiple"
|
|
|
- :readonly="column.readonly"
|
|
|
- :value-key="column.valueKey"
|
|
|
- :placeholder="column.placeholder"
|
|
|
- :data-mapping="column.dataMapping"
|
|
|
- :query-params="column.queryParams(params)"
|
|
|
+ <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
|
|
|
+ <el-col
|
|
|
+ v-for="column in searchColumns"
|
|
|
+ :key="column.title"
|
|
|
+ :span="column.span || 6"
|
|
|
>
|
|
|
- </dr-popover-select>
|
|
|
- <dr-popover-tree-select
|
|
|
- v-if="column.inputType === 'PopoverTreeSelect'"
|
|
|
- v-model="params[column.key]"
|
|
|
- :source.sync="params"
|
|
|
- :title="column.title"
|
|
|
- :type="column.referName"
|
|
|
- :multiple="column.multiple"
|
|
|
- :show-key="column.showKey"
|
|
|
- :value-key="column.valueKey"
|
|
|
- :placeholder="column.placeholder"
|
|
|
- :data-mapping="column.dataMapping"
|
|
|
- :query-params="column.queryParams(params)"
|
|
|
- >
|
|
|
- </dr-popover-tree-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- circle
|
|
|
- :size="size"
|
|
|
- icon="el-icon-search"
|
|
|
- @click="handleQueryList(params, page)"
|
|
|
- ></el-button>
|
|
|
- <el-button
|
|
|
- circle
|
|
|
- :size="size"
|
|
|
- icon="el-icon-refresh"
|
|
|
- @click="handleResetList"
|
|
|
- ></el-button>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item :prop="column.key" :label="column.title">
|
|
|
+ <el-input
|
|
|
+ v-if="column.inputType === 'Input'"
|
|
|
+ v-model="params[column.key]"
|
|
|
+ :disabled="column.disabled"
|
|
|
+ :clearable="column.clearable"
|
|
|
+ :placeholder="column.placeholder"
|
|
|
+ style="width: 100%"
|
|
|
+ ></el-input>
|
|
|
+ <el-select
|
|
|
+ v-if="column.inputType === 'Select'"
|
|
|
+ v-model="params[column.key]"
|
|
|
+ :disabled="column.disabled"
|
|
|
+ :clearable="column.clearable"
|
|
|
+ :placeholder="column.placeholder"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dict.type[column.referName]"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-date-picker
|
|
|
+ v-if="column.inputType === 'DatePicker'"
|
|
|
+ v-model="params[column.key]"
|
|
|
+ :type="column.type"
|
|
|
+ :placeholder="column.placeholder"
|
|
|
+ :value-format="column.valueFormat"
|
|
|
+ :unlink-panels="column.unlinkPanels"
|
|
|
+ :picker-options="column.pickerOptions"
|
|
|
+ :range-separator="column.rangeSeparator"
|
|
|
+ :end-placeholder="column.endPlaceholder"
|
|
|
+ :start-placeholder="column.startPlaceholder"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ <dr-popover-select
|
|
|
+ v-if="column.inputType === 'PopoverSelect'"
|
|
|
+ v-model="params[column.key]"
|
|
|
+ :size="size"
|
|
|
+ :source.sync="params"
|
|
|
+ :title="column.title"
|
|
|
+ :type="column.referName"
|
|
|
+ :multiple="column.multiple"
|
|
|
+ :readonly="column.readonly"
|
|
|
+ :value-key="column.valueKey"
|
|
|
+ :placeholder="column.placeholder"
|
|
|
+ :data-mapping="column.dataMapping"
|
|
|
+ :query-params="column.queryParams(params)"
|
|
|
+ >
|
|
|
+ </dr-popover-select>
|
|
|
+ <dr-popover-tree-select
|
|
|
+ v-if="column.inputType === 'PopoverTreeSelect'"
|
|
|
+ v-model="params[column.key]"
|
|
|
+ :source.sync="params"
|
|
|
+ :title="column.title"
|
|
|
+ :type="column.referName"
|
|
|
+ :multiple="column.multiple"
|
|
|
+ :show-key="column.showKey"
|
|
|
+ :value-key="column.valueKey"
|
|
|
+ :placeholder="column.placeholder"
|
|
|
+ :data-mapping="column.dataMapping"
|
|
|
+ :query-params="column.queryParams(params)"
|
|
|
+ >
|
|
|
+ </dr-popover-tree-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <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="handleExport(params, page)">
|
|
|
+ <el-button :size="size" @click="useExport(params, page)">
|
|
|
导 出
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
:size="size"
|
|
|
:disabled="selectData.length !== 1"
|
|
|
- @click="handleModifyBuyer(selectData[0])"
|
|
|
+ @click="openModifyBuyerDialog(selectData[0])"
|
|
|
>
|
|
|
转 派
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
:size="size"
|
|
|
:disabled="!selectData.length"
|
|
|
- @click="handleDocumentsReturn(selectData)"
|
|
|
+ @click="openDocumentsReturnDialog(selectData)"
|
|
|
>
|
|
|
退回需求
|
|
|
</el-button>
|
|
|
<!-- <el-button
|
|
|
:size="size"
|
|
|
:disabled="selectData.length !== 1"
|
|
|
- @click="handleShutDown(selectData[0])"
|
|
|
+ @click="shutDown(selectData[0])"
|
|
|
>
|
|
|
行关闭
|
|
|
</el-button> -->
|
|
|
<el-button
|
|
|
:size="size"
|
|
|
:disabled="!selectData.length"
|
|
|
- @click="handleOpenFristDirectDrawer(selectData)"
|
|
|
+ @click="openFristDirectDialog(selectData)"
|
|
|
>
|
|
|
协议直采
|
|
|
</el-button>
|
|
@@ -293,8 +292,8 @@ export default {
|
|
|
:data="tableData"
|
|
|
size="mini"
|
|
|
style="width: 100%; margin: 20px 0 0 0"
|
|
|
- @row-dblclick="handleOpenSeeDrawer"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ @row-dblclick="openSeeDialog"
|
|
|
+ @selection-change="selectionChange"
|
|
|
>
|
|
|
<el-table-column fixed width="55" align="center" type="selection">
|
|
|
</el-table-column>
|
|
@@ -318,8 +317,8 @@ export default {
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @current-change="currentChange"
|
|
|
:total="page.total"
|
|
|
:page-sizes="pageSizes"
|
|
|
:page-size="page.pageSize"
|