|
@@ -0,0 +1,312 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-breadcrumb separator=">">
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>
|
|
|
+ <a href="#">工作信息管理</a>
|
|
|
+ </el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>
|
|
|
+ <a href="/base/orderForm">订单管理</a>
|
|
|
+ </el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <!--
|
|
|
+ 要resetFields起作用,必须配置:model和prop
|
|
|
+ -->
|
|
|
+ <el-form ref="queryForm" :model="queryModel" inline class="demo-form-inline">
|
|
|
+ <el-form-item label="客户名称" prop="clientName">
|
|
|
+ <el-input type="text" size="mini" v-model="queryModel.clientName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="客户订单号" prop="clientOrderNumber">
|
|
|
+ <el-input type="text" size="mini" v-model="queryModel.clientOrderNumber"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="菲利华订单号" prop="feilihuaOrderNumber">
|
|
|
+ <el-input type="text" size="mini" v-model="queryModel.feilihuaOrderNumber"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品名称" prop="productName">
|
|
|
+ <el-input type="text" size="mini" v-model="queryModel.productName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini" icon="ios-search" @click="changePage(1)" :loading="loading">查询</el-button>
|
|
|
+ <el-button type="info" size="mini" style="margin-left: 8px" @click="handleReset('queryForm')">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-row class="button-group">
|
|
|
+ <el-button type="primary" size="small" plain icon="el-icon-circle-plus" @click="handleAdd">新增</el-button>
|
|
|
+ <el-button type="primary" size="small" plain icon="el-icon-circle-plus" :disabled="multipleSelection.length == 0" @click="handleBatchDelete">删除选中项</el-button>
|
|
|
+ <el-button type="primary" size="small" plain icon="el-icon-upload2" @click="batchImportVisible = true">导入</el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-table :data="tableData" style="min-height: 400px" v-loading="loading" stripe @sort-change="sortChange" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
+ <el-table-column prop="clientEmail" label="客户邮箱" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="clientName" label="客户名称" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="clientOrderNumber" label="客户订单号" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="feilihuaOrderNumber" label="菲利华订单号" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="productName" label="产品名称" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="trademark" label="牌号" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="productSpecification" label="产品规格" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="orderQuantity" label="订单数量" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="unit" label="单位" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="requiredDeliveryTime" label="要求交期" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="reviewDeliveryTime" label="评审交期" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="stockQuantity" label="库存数量" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="productionQuantity" label="还需生产数量" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="expiryTime" label="过期时间" width="180"></el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ :current-page.sync="pageIndex"
|
|
|
+ :total="totalElements"
|
|
|
+ :page-sizes="pageSizeList"
|
|
|
+ @current-change="changePage"
|
|
|
+ @size-change="pageSizeChange"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ ></el-pagination>
|
|
|
+ <orderForm-detail
|
|
|
+ v-if="showModal"
|
|
|
+ :businessKey="businessKey"
|
|
|
+ :title="modalTitle"
|
|
|
+ @close="onDetailModalClose"
|
|
|
+ ></orderForm-detail>
|
|
|
+ <el-dialog title="导入" :visible.sync="batchImportVisible" :modal-append-to-body="false" style="text-align: left" :close-on-click-modal="false">
|
|
|
+ <el-form label-width="150px">
|
|
|
+ <el-form-item label="模板下载">
|
|
|
+ <el-link href="http://admission-46879.oss-cn-hangzhou.aliyuncs.com/upload/excellent/template/orderForm.xls" type="primary" target="_blank">点击下载模板</el-link>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上传文件">
|
|
|
+ <el-upload class="upload-demo" accept=".xls" :action="uploadUrlXls" :headers="headers" name="uploadFile" :on-success="handleBatchImportSuccess">
|
|
|
+ <el-button size="small" type="primary" :loading="xlsLoading">点击上传</el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
+ 只能上传xls文件,且不超过500kb
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="batchImportVisible = false" >关 闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import Constant from "@/constant";
|
|
|
+import OrderFormDetail from "./orderForm-detail";
|
|
|
+import orderFormApi from "@/api/base/orderForm";
|
|
|
+import NProgress from "nprogress"; // progress bar
|
|
|
+import "nprogress/nprogress.css"; // progress bar style
|
|
|
+import {getToken} from "@/utils/auth";
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ return {
|
|
|
+ queryModel: {
|
|
|
+ clientName: "",
|
|
|
+ clientOrderNumber: "",
|
|
|
+ feilihuaOrderNumber: "",
|
|
|
+ productName: "",
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
+ xlsLoading: false,
|
|
|
+ tableData: [],
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalPages: 0,
|
|
|
+ totalElements: 0,
|
|
|
+ field: "",
|
|
|
+ direction: "",
|
|
|
+ pageSizeList: [10, 20, 30],
|
|
|
+ multipleSelection: [],
|
|
|
+ showModal: false,
|
|
|
+ modalTitle: "",
|
|
|
+ businessKey: "",
|
|
|
+ batchImportVisible: false,
|
|
|
+ uploadUrlXls: Constant.serverUrl + "/base/orderForm/importXls",
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ changePage(pageIndex) {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ self.loading = true;
|
|
|
+
|
|
|
+ self.pageIndex = pageIndex;
|
|
|
+ var formData = new FormData();
|
|
|
+
|
|
|
+ formData.append("pageIndex", self.pageIndex);
|
|
|
+ formData.append("pageSize", self.pageSize);
|
|
|
+
|
|
|
+ formData.append("clientName", self.queryModel.clientName);
|
|
|
+ formData.append("clientOrderNumber", self.queryModel.clientOrderNumber);
|
|
|
+ formData.append("feilihuaOrderNumber", self.queryModel.feilihuaOrderNumber);
|
|
|
+ formData.append("productName", self.queryModel.productName);
|
|
|
+
|
|
|
+ if (this.field != null) {
|
|
|
+ formData.append("field", this.field);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.direction != null) {
|
|
|
+ formData.append("direction", this.direction);
|
|
|
+ }
|
|
|
+
|
|
|
+ orderFormApi
|
|
|
+ .pageList(formData)
|
|
|
+ .then(function (response) {
|
|
|
+ self.loading = false;
|
|
|
+
|
|
|
+ var jsonData = response.data.data;
|
|
|
+
|
|
|
+ self.tableData = jsonData.data;
|
|
|
+ self.totalPages = jsonData.totalPages;
|
|
|
+ self.totalElements = jsonData.recordsTotal;
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ self.loading = false;
|
|
|
+ // self.$message.error(error + "");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ pageSizeChange(pageSize) {
|
|
|
+ this.pageSize = pageSize;
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.changePage(this.pageIndex);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sortChange(data) {
|
|
|
+ this.field = data.column.field;
|
|
|
+ this.direction = data.order;
|
|
|
+
|
|
|
+ this.changePage(this.pageIndex);
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
+ handleReset(name) {
|
|
|
+ this.$refs[name].resetFields();
|
|
|
+ },
|
|
|
+ handleAdd() {
|
|
|
+ this.modalTitle = "新增";
|
|
|
+ this.businessKey = "";
|
|
|
+ this.showModal = true;
|
|
|
+ },
|
|
|
+ handleEdit(record) {
|
|
|
+ this.modalTitle = "编辑";
|
|
|
+ this.businessKey = record.id;
|
|
|
+ this.showModal = true;
|
|
|
+ },
|
|
|
+ handleDelete(record) {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ self
|
|
|
+ .$confirm("是否确认删除?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ orderFormApi.remove(record.id).then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ // var index = self.tableData.indexOf(record);
|
|
|
+ // self.tableData.splice(index, 1);
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleBatchDelete() {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ var idList = this.multipleSelection.map((record) => {
|
|
|
+ return record.id;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$confirm("是否确认删除选中项?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ orderFormApi.batchRemove(idList).then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onDetailModalClose(refreshed) {
|
|
|
+ //保存成功后回调
|
|
|
+ this.showModal = false;
|
|
|
+
|
|
|
+ if (refreshed) {
|
|
|
+ this.changePage(this.pageIndex);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleBatchImportSuccess(response) {
|
|
|
+ var self = this;
|
|
|
+ self.xlsLoading = false;
|
|
|
+ self.batchImportVisible = false;
|
|
|
+
|
|
|
+ if (response.result) {
|
|
|
+ self.$message.success(response.message);
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ showClose: true,
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: response.message + `,<a href="${response.data}" target="_blank">点击下载未导入的数据报表</a> `,
|
|
|
+ duration: 30000,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ this.changePage(1);
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ "orderForm-detail": OrderFormDetail,
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.el-breadcrumb {
|
|
|
+ margin: 10px;
|
|
|
+ line-height: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-divider {
|
|
|
+ margin: 5px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.demo-form-inline {
|
|
|
+ margin-left: 10px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+
|
|
|
+.button-group {
|
|
|
+ margin-left: 10px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+</style>
|