|
@@ -0,0 +1,557 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="物品类型" prop="wuPinType">
|
|
|
+ <el-select v-model="queryParams.wuPinType" placeholder="请选择物品类型" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物品名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.name"
|
|
|
+ placeholder="请输入物品名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物资规格" prop="materialSpecification">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.materialSpecification"
|
|
|
+ placeholder="请输入物资规格"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物资型号" prop="materialXh">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.materialXh"
|
|
|
+ placeholder="请输入物资型号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="营具类型" prop="yingJuType">
|
|
|
+ <el-select v-model="queryParams.yingJuType" placeholder="请选择营具类型" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="责任单位" prop="responsibilityUnit">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.responsibilityUnit"
|
|
|
+ placeholder="请输入责任单位"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="责任人" prop="personLiable">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.personLiable"
|
|
|
+ placeholder="请输入责任人"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="出库数量" prop="putOut">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.putOut"
|
|
|
+ placeholder="请输入出库数量"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="创建人" prop="createName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.createName"
|
|
|
+ placeholder="请输入创建人"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发放时间" prop="putOutTime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="queryParams.putOutTime"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择发放时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="存放位置" prop="storageLocation">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.storageLocation"
|
|
|
+ placeholder="请输入存放位置"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="购买时间" prop="buyingTime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="queryParams.buyingTime"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择购买时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="价值" prop="price">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.price"
|
|
|
+ placeholder="请输入价值"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="库房" prop="warehouse">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.warehouse"
|
|
|
+ placeholder="请输入库房"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="档案id" prop="archivesId">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.archivesId"
|
|
|
+ placeholder="请输入档案id"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="现有数量" prop="total">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.total"
|
|
|
+ placeholder="请输入现有数量"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发放单位" prop="outUnit">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.outUnit"
|
|
|
+ placeholder="请输入发放单位"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发放对象" prop="outPeople">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.outPeople"
|
|
|
+ placeholder="请输入发放对象"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接收人" prop="recipient">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.recipient"
|
|
|
+ placeholder="请输入接收人"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="入库表id" prop="registrationId">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.registrationId"
|
|
|
+ placeholder="请输入入库表id"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </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="['materialManagement:distribution:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['materialManagement:distribution:edit']"
|
|
|
+ >修改</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="['materialManagement:distribution:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['materialManagement:distribution:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="distributionList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="主键id" align="center" prop="id" />
|
|
|
+ <el-table-column label="物品类型" align="center" prop="wuPinType" />
|
|
|
+ <el-table-column label="物品名称" align="center" prop="name" />
|
|
|
+ <el-table-column label="物资规格" align="center" prop="materialSpecification" />
|
|
|
+ <el-table-column label="物资型号" align="center" prop="materialXh" />
|
|
|
+ <el-table-column label="营具类型" align="center" prop="yingJuType" />
|
|
|
+ <el-table-column label="责任单位" align="center" prop="responsibilityUnit" />
|
|
|
+ <el-table-column label="责任人" align="center" prop="personLiable" />
|
|
|
+ <el-table-column label="出库数量" align="center" prop="putOut" />
|
|
|
+ <el-table-column label="创建人" align="center" prop="createName" />
|
|
|
+ <el-table-column label="发放时间" align="center" prop="putOutTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.putOutTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="存放位置" align="center" prop="storageLocation" />
|
|
|
+ <el-table-column label="购买时间" align="center" prop="buyingTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.buyingTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="价值" align="center" prop="price" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" />
|
|
|
+ <el-table-column label="库房" align="center" prop="warehouse" />
|
|
|
+ <el-table-column label="档案id" align="center" prop="archivesId" />
|
|
|
+ <el-table-column label="现有数量" align="center" prop="total" />
|
|
|
+ <el-table-column label="发放单位" align="center" prop="outUnit" />
|
|
|
+ <el-table-column label="发放对象" align="center" prop="outPeople" />
|
|
|
+ <el-table-column label="接收人" align="center" prop="recipient" />
|
|
|
+ <el-table-column label="入库表id" align="center" prop="registrationId" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['materialManagement:distribution:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['materialManagement:distribution:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改物资发放对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="物品类型" prop="wuPinType">
|
|
|
+ <el-select v-model="form.wuPinType" placeholder="请选择物品类型">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物品名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入物品名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物资规格" prop="materialSpecification">
|
|
|
+ <el-input v-model="form.materialSpecification" placeholder="请输入物资规格" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物资型号" prop="materialXh">
|
|
|
+ <el-input v-model="form.materialXh" placeholder="请输入物资型号" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="营具类型" prop="yingJuType">
|
|
|
+ <el-select v-model="form.yingJuType" placeholder="请选择营具类型">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="责任单位" prop="responsibilityUnit">
|
|
|
+ <el-input v-model="form.responsibilityUnit" placeholder="请输入责任单位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="责任人" prop="personLiable">
|
|
|
+ <el-input v-model="form.personLiable" placeholder="请输入责任人" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="出库数量" prop="putOut">
|
|
|
+ <el-input v-model="form.putOut" placeholder="请输入出库数量" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="创建人" prop="createName">
|
|
|
+ <el-input v-model="form.createName" placeholder="请输入创建人" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发放时间" prop="putOutTime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="form.putOutTime"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择发放时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="存放位置" prop="storageLocation">
|
|
|
+ <el-input v-model="form.storageLocation" placeholder="请输入存放位置" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="购买时间" prop="buyingTime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="form.buyingTime"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择购买时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="价值" prop="price">
|
|
|
+ <el-input v-model="form.price" placeholder="请输入价值" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="库房" prop="warehouse">
|
|
|
+ <el-input v-model="form.warehouse" placeholder="请输入库房" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="档案id" prop="archivesId">
|
|
|
+ <el-input v-model="form.archivesId" placeholder="请输入档案id" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="现有数量" prop="total">
|
|
|
+ <el-input v-model="form.total" placeholder="请输入现有数量" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发放单位" prop="outUnit">
|
|
|
+ <el-input v-model="form.outUnit" placeholder="请输入发放单位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发放对象" prop="outPeople">
|
|
|
+ <el-input v-model="form.outPeople" placeholder="请输入发放对象" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接收人" prop="recipient">
|
|
|
+ <el-input v-model="form.recipient" placeholder="请输入接收人" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="入库表id" prop="registrationId">
|
|
|
+ <el-input v-model="form.registrationId" placeholder="请输入入库表id" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listDistribution, getDistribution, delDistribution, addDistribution, updateDistribution, exportDistribution } from "@/api/materialManagement/distribution";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Distribution",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 导出遮罩层
|
|
|
+ exportLoading: false,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 物资发放表格数据
|
|
|
+ distributionList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ wuPinType: null,
|
|
|
+ name: null,
|
|
|
+ materialSpecification: null,
|
|
|
+ materialXh: null,
|
|
|
+ yingJuType: null,
|
|
|
+ responsibilityUnit: null,
|
|
|
+ personLiable: null,
|
|
|
+ putOut: null,
|
|
|
+ createName: null,
|
|
|
+ putOutTime: null,
|
|
|
+ storageLocation: null,
|
|
|
+ buyingTime: null,
|
|
|
+ price: null,
|
|
|
+ warehouse: null,
|
|
|
+ archivesId: null,
|
|
|
+ total: null,
|
|
|
+ outUnit: null,
|
|
|
+ outPeople: null,
|
|
|
+ recipient: null,
|
|
|
+ registrationId: null
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询物资发放列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listDistribution(this.queryParams).then(response => {
|
|
|
+ this.distributionList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ wuPinType: null,
|
|
|
+ name: null,
|
|
|
+ materialSpecification: null,
|
|
|
+ materialXh: null,
|
|
|
+ yingJuType: null,
|
|
|
+ responsibilityUnit: null,
|
|
|
+ personLiable: null,
|
|
|
+ putOut: null,
|
|
|
+ createName: null,
|
|
|
+ createTime: null,
|
|
|
+ putOutTime: null,
|
|
|
+ storageLocation: null,
|
|
|
+ buyingTime: null,
|
|
|
+ price: null,
|
|
|
+ remark: null,
|
|
|
+ warehouse: null,
|
|
|
+ archivesId: null,
|
|
|
+ total: null,
|
|
|
+ outUnit: null,
|
|
|
+ outPeople: null,
|
|
|
+ recipient: null,
|
|
|
+ registrationId: 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
|
|
|
+ getDistribution(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改物资发放";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateDistribution(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addDistribution(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 delDistribution(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.queryParams;
|
|
|
+ this.$modal.confirm('是否确认导出所有物资发放数据项?').then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportDistribution(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.$download.name(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|