|
@@ -1,10 +1,371 @@
|
|
<template>
|
|
<template>
|
|
-<div>aaaaaaa</div>
|
|
|
|
|
|
+ <div class="app-container">
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
+ <el-form-item label="编码" prop="code">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.code"
|
|
|
|
+ placeholder="请输入编码"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="目标名称" prop="goalName">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.goalName"
|
|
|
|
+ placeholder="请输入目标名称"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="单据日期" prop="documentDate">
|
|
|
|
+ <el-date-picker clearable
|
|
|
|
+ v-model="queryParams.documentDate"
|
|
|
|
+ type="date"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ placeholder="请选择单据日期">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="年度" prop="annual">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="queryParams.annual"
|
|
|
|
+ type="year"
|
|
|
|
+ value-format="yyyy"
|
|
|
|
+ placeholder="选择年度"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="客户" prop="custom">
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.custom" title="客户" valueKey="name"
|
|
|
|
+ referName="CUSTOMER_PARAM"
|
|
|
|
+ :dataMapping="{ customCode: 'code', custom: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入客户" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="制单人" prop="creator">
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.creator" title="制单人" valueKey="name"
|
|
|
|
+ referName="CONTACTS_PARAM"
|
|
|
|
+ :dataMapping="{ creatorCode: 'code', creator: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入制单人" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="销售区域" prop="saleZone">
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.saleZone" title="销售区域" valueKey="name"
|
|
|
|
+ referName="CUSTOMER_PARAM"
|
|
|
|
+ :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入销售区域" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="部门" prop="dept">
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.dept" title="部门" valueKey="name"
|
|
|
|
+ referName="DEPT_PARAM"
|
|
|
|
+ :dataMapping="{ deptCode: 'code', dept: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入部门" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleAdd"
|
|
|
|
+ v-hasPermi="['goal_management:monthSaleGoal:add']"
|
|
|
|
+ >新增
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="multiple"
|
|
|
|
+ @click="handleDelete"
|
|
|
|
+ v-hasPermi="['goal_management:monthSaleGoal:remove']"
|
|
|
|
+ >删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="warning"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ v-hasPermi="['goal_management:monthSaleGoal:export']"
|
|
|
|
+ >导出
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange">
|
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
|
+ <el-table-column label="编码" align="center" prop="code"/>
|
|
|
|
+ <el-table-column label="目标名称" align="center" prop="goalName"/>
|
|
|
|
+ <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="年度" align="center" prop="annual"/>
|
|
|
|
+ <el-table-column label="客户" align="center" prop="custom"/>
|
|
|
|
+ <el-table-column label="销售区域" align="center" prop="saleZone"/>
|
|
|
|
+ <el-table-column label="制单人" align="center" prop="creator"/>
|
|
|
|
+ <el-table-column label="部门" align="center" prop="dept"/>
|
|
|
|
+ <el-table-column label="目标合计" align="center" prop="goalSum"/>
|
|
|
|
+ <el-table-column label="备注" align="center" prop="notes"/>
|
|
|
|
+ <el-table-column label="单据状态" align="center" prop="documentStatus"/>
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140" fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
|
+ v-hasPermi="['goal_management:monthSaleGoal:edit']"
|
|
|
|
+ >修改
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['goal_management:monthSaleGoal:remove']"
|
|
|
|
+ >删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+
|
|
|
|
+import {
|
|
|
|
+ listMonthReturnGoal,
|
|
|
|
+ getMonthReturnGoal,
|
|
|
|
+ addMonthReturnGoal,
|
|
|
|
+ updateMonthReturnGoal,
|
|
|
|
+ delMonthReturnGoal
|
|
|
|
+} from "@/api/business/spd/goal_management/monthReturnGoal"
|
|
|
|
+
|
|
|
|
+// 树形参照
|
|
|
|
+import TreeRefers from '@/components/Refers/treeRefer.vue'
|
|
|
|
+import ElPopoverSelectV2 from "@/components/popover-select-v2"
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
- name: "MonthReturnGoal"
|
|
|
|
|
|
+ name: "MonthReturnGoal",
|
|
|
|
+ components: {
|
|
|
|
+ TreeRefers, ElPopoverSelectV2
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ // 遮罩层
|
|
|
|
+ loading: true,
|
|
|
|
+ // 选中数组
|
|
|
|
+ ids: [],
|
|
|
|
+ // 非单个禁用
|
|
|
|
+ single: true,
|
|
|
|
+ // 非多个禁用
|
|
|
|
+ multiple: true,
|
|
|
|
+ // 显示搜索条件
|
|
|
|
+ showSearch: true,
|
|
|
|
+ // 总条数
|
|
|
|
+ total: 0,
|
|
|
|
+ // 月回款目标填报表格数据
|
|
|
|
+ monthReturnGoalList: [],
|
|
|
|
+ monthReturnGoalDetailsList: [],
|
|
|
|
+ // 弹出层标题
|
|
|
|
+ title: "",
|
|
|
|
+ // 是否显示弹出层
|
|
|
|
+ open: false,
|
|
|
|
+ // 查询参数
|
|
|
|
+ queryParams: {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ code: null,
|
|
|
|
+ goalName: null,
|
|
|
|
+ documentDate: null,
|
|
|
|
+ annual: null,
|
|
|
|
+ customCode: null,
|
|
|
|
+ custom: null,
|
|
|
|
+ creatorCode: null,
|
|
|
|
+ creator: null,
|
|
|
|
+ saleZoneCode: null,
|
|
|
|
+ saleZone: null,
|
|
|
|
+ deptCode: null,
|
|
|
|
+ dept: null,
|
|
|
|
+ goalSum: null,
|
|
|
|
+ notes: null,
|
|
|
|
+ documentStatus: null,
|
|
|
|
+ documentDateRange: null
|
|
|
|
+ },
|
|
|
|
+ // 表单参数
|
|
|
|
+ form: {
|
|
|
|
+ id: null,
|
|
|
|
+ code: null,
|
|
|
|
+ goalName: null,
|
|
|
|
+ documentDate: null,
|
|
|
|
+ annual: null,
|
|
|
|
+ customCode: null,
|
|
|
|
+ custom: null,
|
|
|
|
+ creatorCode: null,
|
|
|
|
+ creator: null,
|
|
|
|
+ saleZoneCode: null,
|
|
|
|
+ saleZone: null,
|
|
|
|
+ deptCode: null,
|
|
|
|
+ dept: null,
|
|
|
|
+ goalSum: null,
|
|
|
|
+ notes: null,
|
|
|
|
+ documentStatus: null,
|
|
|
|
+ monthReturnGoalDetailsList: null,
|
|
|
|
+ },
|
|
|
|
+ formDetails: {
|
|
|
|
+ id: null,
|
|
|
|
+ code: null,
|
|
|
|
+ saleOrg: null,
|
|
|
|
+ saleZone: null,
|
|
|
|
+ custom: null,
|
|
|
|
+ creator: null,
|
|
|
|
+ monthly: null,
|
|
|
|
+ goalSum: null
|
|
|
|
+ },
|
|
|
|
+ // 表单校验
|
|
|
|
+ rules: {},
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ /** 查询月销售目标填报列表 */
|
|
|
|
+ getList() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ listMonthReturnGoal(this.queryParams).then(response => {
|
|
|
|
+ this.monthReturnGoalList = response.rows;
|
|
|
|
+ this.total = response.total;
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 取消按钮
|
|
|
|
+ cancel() {
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.reset();
|
|
|
|
+ },
|
|
|
|
+ // 表单重置
|
|
|
|
+ reset() {
|
|
|
|
+ this.form = {
|
|
|
|
+ id: null,
|
|
|
|
+ code: null,
|
|
|
|
+ goalName: null,
|
|
|
|
+ documentDate: null,
|
|
|
|
+ annual: null,
|
|
|
|
+ customCode: null,
|
|
|
|
+ custom: null,
|
|
|
|
+ creatorCode: null,
|
|
|
|
+ creator: null,
|
|
|
|
+ saleZoneCode: null,
|
|
|
|
+ saleZone: null,
|
|
|
|
+ deptCode: null,
|
|
|
|
+ dept: null,
|
|
|
|
+ goalSum: null,
|
|
|
|
+ notes: null,
|
|
|
|
+ documentStatus: null,
|
|
|
|
+ monthReturnGoalDetailsList: null,
|
|
|
|
+ };
|
|
|
|
+ this.resetForm("form");
|
|
|
|
+ },
|
|
|
|
+ /** 搜索按钮操作 */
|
|
|
|
+ handleQuery() {
|
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ /** 重置按钮操作 */
|
|
|
|
+ resetQuery() {
|
|
|
|
+ this.resetForm("queryForm");
|
|
|
|
+ this.handleQuery();
|
|
|
|
+ },
|
|
|
|
+ // 多选框选中数据
|
|
|
|
+ handleSelectionChange(selection) {
|
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
|
+ this.single = selection.length !== 1
|
|
|
|
+ this.multiple = !selection.length
|
|
|
|
+ },
|
|
|
|
+ /** 新增按钮操作 */
|
|
|
|
+ handleAdd() {
|
|
|
|
+ this.reset();
|
|
|
|
+ this.open = true;
|
|
|
|
+ this.title = "添加--月回款目标填报";
|
|
|
|
+ },
|
|
|
|
+ /** 修改按钮操作 */
|
|
|
|
+ handleUpdate(row) {
|
|
|
|
+ this.reset();
|
|
|
|
+ const id = row.id || this.ids
|
|
|
|
+ getMonthReturnGoal(id).then(response => {
|
|
|
|
+ this.form = response.data;
|
|
|
|
+ this.monthReturnGoalDetailsList = this.form.monthReturnGoalDetailsList
|
|
|
|
+ this.open = true;
|
|
|
|
+ this.title = "修改--月销售目标填报";
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 提交按钮 */
|
|
|
|
+ submitForm() {
|
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if (this.form.id != null) {
|
|
|
|
+ this.form.monthReturnGoalDetailsList = this.monthReturnGoalDetailsList
|
|
|
|
+ updateMonthReturnGoal(this.form).then(response => {
|
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.form.documentStatus = '未提交'
|
|
|
|
+ this.form.monthReturnGoalDetailsList = this.monthReturnGoalDetailsList
|
|
|
|
+ console.log(this.form);
|
|
|
|
+ addMonthReturnGoal(this.form).then(response => {
|
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 删除按钮操作 */
|
|
|
|
+ handleDelete(row) {
|
|
|
|
+ const ids = row.id || this.ids;
|
|
|
|
+ this.$modal.confirm('是否确认删除月销售目标填报编号为"' + ids + '"的数据项?').then(function () {
|
|
|
|
+ return delMonthReturnGoal(ids);
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /** 导出按钮操作 */
|
|
|
|
+ handleExport() {
|
|
|
|
+ this.download('goal_management/monthReturnGoal/export', {
|
|
|
|
+ ...this.queryParams
|
|
|
|
+ }, `monthReturnGoal_${new Date().getTime()}.xlsx`)
|
|
|
|
+ },
|
|
|
|
+ handleClose(done) {
|
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
|
+ .then(_ => {
|
|
|
|
+ done();
|
|
|
|
+ })
|
|
|
|
+ .catch(_ => {
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|