|
|
@@ -0,0 +1,672 @@
|
|
|
+<template>
|
|
|
+ <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="preSalesOrderNumber">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.preSalesOrderNumber"
|
|
|
+ placeholder="请输入销售订单"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="客户代号" prop="customerCode">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.customerCode"
|
|
|
+ placeholder="请输入客户代号"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="客户名称" prop="customerName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.customerName"
|
|
|
+ placeholder="请输入客户名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品编码" prop="productCode">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.productCode"
|
|
|
+ placeholder="请输入产品编码"
|
|
|
+ clearable
|
|
|
+ @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"
|
|
|
+
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ >修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleExpect"
|
|
|
+ >交期预估</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleAllExpect"
|
|
|
+ >全部预估</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" >导入</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="salesorderList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="序号" align="center" prop="id" />
|
|
|
+ <el-table-column label="销售订单" align="center" prop="preSalesOrderNumber" />
|
|
|
+ <el-table-column label="客户代号" align="center" prop="customerCode" />
|
|
|
+ <el-table-column label="客户名称" align="center" prop="customerName" />
|
|
|
+ <el-table-column label="产品描述" align="center" prop="productDescription" />
|
|
|
+ <el-table-column label="产品编码" align="center" prop="productCode" />
|
|
|
+ <el-table-column label="订单数量" align="center" prop="orderQuantity" />
|
|
|
+ <el-table-column label="单位" align="center" prop="unit" />
|
|
|
+ <el-table-column label="重量" align="center" prop="weightKg" />
|
|
|
+ <el-table-column label="客户交期" align="center" prop="customerDeliveryDate" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.customerDeliveryDate }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="生产交期" align="center" prop="productionDeliveryDate" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.productionDeliveryDate }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="材料编码" align="center" prop="materialCode" />
|
|
|
+ <el-table-column label="材料描述" align="center" prop="materialDescription" />
|
|
|
+ <el-table-column label="物料数量" align="center" prop="materialQuantity" />
|
|
|
+ <el-table-column label="物料单位" align="center" prop="materialUnit" />
|
|
|
+ <el-table-column label="物料重量" align="center" prop="materialWeightKg" />
|
|
|
+ <el-table-column label="订单状态" align="center" prop="status" />
|
|
|
+ <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)"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<!-- 添加或修改销售订单对话框 -->
|
|
|
+ <el-dialog :title="titleExpect" :visible.sync="openExpect" width="70%" :close-on-click-modal="false" modal-append-to-body>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="salesorderExpectList" >
|
|
|
+ <el-table-column label="序号" align="center" prop="id" />
|
|
|
+ <el-table-column label="年份" align="center" prop="year" />
|
|
|
+ <el-table-column label="月份" align="center" prop="month" />
|
|
|
+ <el-table-column label="日期" align="center" prop="day" />
|
|
|
+ <el-table-column label="预计交付日期" align="center" prop="deliverDay" />
|
|
|
+ <el-table-column label="规划产能(吨)" align="center" prop="plannedCapacity" />
|
|
|
+ <el-table-column label="已排产产能" align="center" prop="plannedSumCapacity" />
|
|
|
+ <el-table-column label="未排产产能" align="center" prop="unplannedSumCapacity" />
|
|
|
+ <el-table-column label="本次排产产能" align="center" prop="currenPlannedSumCapacity" />
|
|
|
+ <el-table-column label="已排产单号列表" align="center" prop="plannedOrder" />
|
|
|
+ <el-table-column label="已排产产能列表" align="center" prop="plannedOrderCapacity" />
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" :disabled="single" @click="submitFormExpect">确定交期</el-button>
|
|
|
+ <el-button type="primary" :disabled="multiple" @click="submitFormAllExpect">确定所有交期</el-button>
|
|
|
+ <el-button @click="cancelExpect">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 添加或修改销售订单对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="70%" :close-on-click-modal="false" modal-append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="销售订单" prop="preSalesOrderNumber">
|
|
|
+ <el-input v-model="form.preSalesOrderNumber" placeholder="请输入销售订单" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="客户代号" prop="customerCode">
|
|
|
+ <el-input v-model="form.customerCode" placeholder="请输入客户代号" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="客户名称" prop="customerName">
|
|
|
+ <el-input v-model="form.customerName" placeholder="请输入客户名称" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="产品描述" prop="productDescription">
|
|
|
+ <el-input v-model="form.productDescription" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="产品编码" prop="productCode">
|
|
|
+ <el-input v-model="form.productCode" placeholder="请输入产品编码" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="订单数量" prop="orderQuantity">
|
|
|
+ <el-input v-model="form.orderQuantity" placeholder="请输入订单数量" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="单位" prop="unit">
|
|
|
+ <el-input v-model="form.unit" placeholder="请输入单位" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="重量" prop="weightKg">
|
|
|
+ <el-input v-model="form.weightKg" placeholder="请输入重量" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="客户交期" prop="customerDeliveryDate">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.customerDeliveryDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择客户交期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="生产交期" prop="productionDeliveryDate">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.productionDeliveryDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择生产交期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="材料编码" prop="materialCode">
|
|
|
+ <el-input v-model="form.materialCode" placeholder="请输入材料编码" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="材料描述" prop="materialDescription">
|
|
|
+ <el-input v-model="form.materialDescription" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料数量" prop="materialQuantity">
|
|
|
+ <el-input v-model="form.materialQuantity" placeholder="请输入物料数量" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料单位" prop="materialUnit">
|
|
|
+ <el-input v-model="form.materialUnit" placeholder="请输入物料单位" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物料重量" prop="materialWeightKg">
|
|
|
+ <el-input v-model="form.materialWeightKg" placeholder="请输入物料重量" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <!-- 直报系统导入对话框 -->
|
|
|
+ <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
+ <el-upload ref="upload" :limit="1" accept=".xlsx, .xls,.csv" :headers="upload.headers"
|
|
|
+ :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
|
|
+ :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
+ <div class="el-upload__tip" slot="tip">
|
|
|
+ <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的老数据
|
|
|
+ </div>
|
|
|
+ <span>仅允许导入xls、xlsx、csv格式文件。</span>
|
|
|
+ <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
|
|
+ @click="importTemplate">下载模板</el-link>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listSalesorder, getSalesorder, delSalesorder, addSalesorder, updateSalesorder,listSalesorderExpect,occupyRes,listSalesorderOccupyRes,listSalesorderExpectAll,occupyAllRes} from "@/api/aps/presalesorder";
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Salesorder",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isSubmitting:true,
|
|
|
+ // 用户导入参数
|
|
|
+ upload: {
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
+ title: "",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: {
|
|
|
+ Authorization: "Bearer " +""
|
|
|
+ },
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/aps/salesorder/importData"
|
|
|
+ },
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 销售订单表格数据
|
|
|
+ salesorderList: [],
|
|
|
+ // 销售订单交期预估表格数据
|
|
|
+ salesorderExpectList:[],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题
|
|
|
+ titleExpect: "交期确定",
|
|
|
+ // 是否显示弹出层
|
|
|
+ openExpect: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ page:1,
|
|
|
+ preSalesOrderNumber: null,
|
|
|
+ customerCode: null,
|
|
|
+ customerName: null,
|
|
|
+ productDescription: null,
|
|
|
+ productCode: null,
|
|
|
+ orderQuantity: null,
|
|
|
+ unit: null,
|
|
|
+ weightKg: null,
|
|
|
+ customerDeliveryDate: null,
|
|
|
+ productionDeliveryDate: null,
|
|
|
+ materialCode: null,
|
|
|
+ materialDescription: null,
|
|
|
+ materialQuantity: null,
|
|
|
+ materialUnit: null,
|
|
|
+ materialWeightKg: null
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ preSalesOrderNumber: [
|
|
|
+ { required: true, message: "销售订单不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询销售订单列表 */
|
|
|
+ getList() {
|
|
|
+ console.log("getList")
|
|
|
+ this.loading = true;
|
|
|
+ listSalesorder(this.queryParams).then(response => {
|
|
|
+ console.log(response)
|
|
|
+ this.salesorderList = response;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancelExpect() {
|
|
|
+ this.openExpect = false;
|
|
|
+
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ preSalesOrderNumber: null,
|
|
|
+ customerCode: null,
|
|
|
+ customerName: null,
|
|
|
+ productDescription: null,
|
|
|
+ productCode: null,
|
|
|
+ orderQuantity: null,
|
|
|
+ unit: null,
|
|
|
+ weightKg: null,
|
|
|
+ customerDeliveryDate: null,
|
|
|
+ productionDeliveryDate: null,
|
|
|
+ materialCode: null,
|
|
|
+ materialDescription: null,
|
|
|
+ materialQuantity: null,
|
|
|
+ materialUnit: null,
|
|
|
+ materialWeightKg: 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 = "添加销售订单";
|
|
|
+ },
|
|
|
+ /** 交期预估按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.openExpect = true;
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getSalesorder(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) {
|
|
|
+ updateSalesorder(this.form).then(response => {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addSalesorder(this.form).then(response => {
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交交期确定按钮 */
|
|
|
+ submitFormExpect() {
|
|
|
+ const id = this.ids
|
|
|
+ getSalesorder(id).then(response => {
|
|
|
+ // console.log(response);
|
|
|
+ let saleorder = response;
|
|
|
+ if (saleorder.status=="1") {
|
|
|
+ this.$message.success("已经分配过资源");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var i=0;
|
|
|
+ this.salesorderExpectList.forEach(item=>{
|
|
|
+ i++;
|
|
|
+ item.plannedOrder = saleorder.preSalesOrderNumber+"-"+saleorder.materialCode+"";
|
|
|
+ item.plannedOrderCapacity = item.currenPlannedSumCapacity;
|
|
|
+ item.plannedSumCapacity = item.currenPlannedSumCapacity;
|
|
|
+ });
|
|
|
+
|
|
|
+ var lastNode = this.salesorderExpectList[this.salesorderExpectList.length-1];
|
|
|
+ console.log(lastNode);
|
|
|
+ var productDay = lastNode.deliverDay;
|
|
|
+ saleorder.productionDeliveryDate = productDay;
|
|
|
+ console.log(saleorder.productionDeliveryDate);
|
|
|
+
|
|
|
+ var arr = [];
|
|
|
+ this.salesorderExpectList.forEach(item=>{
|
|
|
+ var node = {};
|
|
|
+ node.id = item.id;
|
|
|
+ node.createTime = item.createTime;
|
|
|
+ node.createUserId = item.createUserId;
|
|
|
+ node.year = item.year;
|
|
|
+ node.month = item.month;
|
|
|
+ node.day = item.day;
|
|
|
+ node.plannedCapacity = item.plannedCapacity;
|
|
|
+ node.unplannedSumCapacity = item.unplannedSumCapacity;
|
|
|
+ node.deliverDay = item.deliverDay;
|
|
|
+ node.currenPlannedSumCapacity = item.currenPlannedSumCapacity;
|
|
|
+ node.plannedSumCapacity = item.plannedSumCapacity;
|
|
|
+ node.plannedOrder = item.plannedOrder;
|
|
|
+ node.plannedOrderCapacity = item.plannedOrderCapacity;
|
|
|
+ node.plannedOrderDate = item.plannedOrderDate;
|
|
|
+ arr.push(node);
|
|
|
+ });
|
|
|
+ occupyRes(arr).then(response => {
|
|
|
+ this.$message.success("占用成功");
|
|
|
+
|
|
|
+ saleorder.data.status = "1";
|
|
|
+ console.log(saleorder.data);
|
|
|
+ updateSalesorder(saleorder.data).then(response => {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.openExpect = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submitFormAllExpect(){
|
|
|
+ var arr = [];
|
|
|
+ this.salesorderExpectList.forEach(item=>{
|
|
|
+ var node = {};
|
|
|
+ node.id = item.id;
|
|
|
+ node.createTime = item.createTime;
|
|
|
+ node.createUserId = item.createUserId;
|
|
|
+ node.year = item.year;
|
|
|
+ node.month = item.month;
|
|
|
+ node.day = item.day;
|
|
|
+ node.plannedCapacity = item.plannedCapacity;
|
|
|
+ node.unplannedSumCapacity = item.unplannedSumCapacity;
|
|
|
+ node.deliverDay = item.deliverDay;
|
|
|
+ node.currenPlannedSumCapacity = item.currenPlannedSumCapacity;
|
|
|
+ node.plannedSumCapacity = item.plannedSumCapacity;
|
|
|
+ node.plannedOrder = item.plannedOrder;
|
|
|
+ node.plannedOrderCapacity = item.plannedOrderCapacity;
|
|
|
+ node.plannedOrderDate = item.plannedOrderDate;
|
|
|
+ arr.push(node);
|
|
|
+ });
|
|
|
+
|
|
|
+ occupyAllRes(arr).then(response => {
|
|
|
+ //console.log(response)
|
|
|
+ this.openExpect = false;
|
|
|
+ this.getList();
|
|
|
+
|
|
|
+ this.$message.success("占用成功");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除销售订单编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delSalesorder(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('aps/salesorder/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `salesorder_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ /*销售单交期预估*/
|
|
|
+ handleExpect(row){
|
|
|
+ const id = row.id || this.ids
|
|
|
+
|
|
|
+ getSalesorder(id).then(response => {
|
|
|
+ let saleorder = response.data;
|
|
|
+ this.form = response.data;
|
|
|
+ console.log(saleorder);
|
|
|
+ //如果是已经占用资源,则显示已经占用的资源,不能重复
|
|
|
+ if (saleorder.status=="1"){
|
|
|
+
|
|
|
+ listSalesorderOccupyRes(saleorder).then(response => {
|
|
|
+ this.salesorderExpectList = response;
|
|
|
+ this.openExpect = true;
|
|
|
+ this.single = true;
|
|
|
+ this.multiple = true;
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+
|
|
|
+ listSalesorderExpect(saleorder).then(response => {
|
|
|
+ this.salesorderExpectList = response;
|
|
|
+ this.openExpect = true;
|
|
|
+ this.single = false;
|
|
|
+ this.multiple = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ //预览
|
|
|
+ handleAllExpect(){
|
|
|
+
|
|
|
+ listSalesorderExpectAll().then(response => {
|
|
|
+
|
|
|
+ this.salesorderExpectList = response;
|
|
|
+ this.openExpect = true;
|
|
|
+ this.single = true;
|
|
|
+ this.multiple = false;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ /** 下载模板操作 */
|
|
|
+ importTemplate() {
|
|
|
+ this.download('aps/salesorder/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ /** 导入按钮操作 */
|
|
|
+ handleImport() {
|
|
|
+ this.upload.title = "销售订单数据导入";
|
|
|
+ this.upload.open = true;
|
|
|
+ },
|
|
|
+ // 提交上传文件
|
|
|
+ submitFileForm() {
|
|
|
+ this.$refs.upload.submit();
|
|
|
+ },
|
|
|
+ // 文件上传中处理
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
+ this.upload.isUploading = true;
|
|
|
+ },
|
|
|
+ // 文件上传成功处理
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
+ this.upload.open = false;
|
|
|
+ this.upload.isUploading = false;
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
+ this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
+ response.msg + "</div>", "导入结果", {
|
|
|
+ dangerouslyUseHTMLString: true
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|