阿赫 4 місяців тому
батько
коміт
275bfa807b

+ 12 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/SaleProducts.java

@@ -77,6 +77,18 @@ public class SaleProducts extends BaseEntity
     @Excel(name = "流程编码")
     private String processKey;
 
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+
+    /** 等级 */
+    @Excel(name = "等级")
+    private String level;
+
 
     /** 产线集合 */
     @Excel(name = "产线集合")

+ 2 - 1
zkqy-custom-business/src/main/resources/mapper/business/SaleProductsMapper.xml

@@ -297,9 +297,10 @@
             <if test="sliceType != null">slice_type = #{sliceType},</if>
             <if test="colourNumber != null">colour_number = #{colourNumber},</if>
             <if test="taskName != null">task_name = #{taskName},</if>
-            <if test="lotNumber != null">lot_number = #{lotNumber},</if>
+            <if test="lotNumber != null and lotNumber != ''">lot_number = #{lotNumber},</if>
             <if test="onBoardState != null">on_board_state = #{onBoardState},</if>
             <if test="colours != null">colours = #{colours},</if>
+            <if test="level != null">`level` = #{level},</if>
         </trim>
         where id = #{id}
     </update>

+ 11 - 0
zkqy-ui/src/api/tablelist/commonTable.js

@@ -72,6 +72,16 @@ export function batchEdit(data) {
   })
 }
 
+//化纤修改动态表单
+export function saleProductsBatchEdit(data) {
+  return request({
+    url: '/dragform/common/saleProductsBatchEdit',
+    method: 'put',
+    data: data,
+    //baseURL: process.env.VUE_APP_BASE_API1
+  })
+}
+
 // 修改动态表单
 export function updateTableData(data) {
   return request({
@@ -374,6 +384,7 @@ export function oldNoticeOutStorage(data) {
     url: '/system/ProductInventory/oldNoticeOutStorage',
     method: 'post',
     data: data,
+    timeout: 1000000000, // 设置超时时间为5秒
     //baseURL: process.env.VUE_APP_BASE_API1
   })
 }

+ 1 - 1
zkqy-ui/src/views/orderMange/comprehensiveInventory/index.vue

@@ -59,7 +59,7 @@
       <el-form-item label="类型" prop="productType">
         <el-input
           v-model="queryParams.productType"
-          placeholder="请输入色泽"
+          placeholder="请输入类型"
           clearable
           @keyup.enter.native="handleQuery"
         />

+ 28 - 15
zkqy-ui/src/views/orderMange/index.vue

@@ -418,7 +418,7 @@
                         :value="item.productName"
                       >
                         <span class="discribe" style="float: left">{{
-                             item.productName
+                             item.productName+"--"+item.productNo
                            }}</span>
                         <!-- <span
                           style="float: right; color: #8492a6; font-size: 13px"
@@ -474,8 +474,8 @@
                       @change="colourNumberChangeHandler(scope.row)"
                     >
                       <el-option
-                        v-for="item in colourNumberOptions"
-                        :key="item.colour"
+                        v-for="(item,index) in colourNumberOptions"
+                        :key="item.colour.index"
                         :label="item.colour"
                         :value="item.colour"
                       >
@@ -881,7 +881,7 @@ import {
   getSaleOrderProductionListDistinct,
   getProductSpecificationsByProductName,
   printOutsourceOrder,
-  productColourList,
+  productColourList, saleProductsBatchEdit,
 } from "@/api/tablelist/commonTable";
 import {getProductInventory, updateOrder} from "@/api/system/retailMange.js";
 import { listData } from "@/api/system/tenant/data";
@@ -2214,7 +2214,7 @@ export default {
           this.productionTableData.forEach((item) => {
             item.saleOrderNo = saleNo;
             item.lotNumber = lotNumber;
-            delete item.id;
+
             delete item.productNotes;
             delete item.updateBy;
             delete item.updateById;
@@ -2284,20 +2284,33 @@ export default {
             };
             let delRes = { code: 200 };
             if (this.productIds.length) {
-              delRes = await delTableData(deletPayload); //删除旧数据
+            //  delRes = await delTableData(deletPayload); //删除旧数据
             }
-
-            let updateSaleRes = await batchEdit(saleData);
+            //let updateSaleRes = await batchEdit(saleData);
             let updateCraftRes = await batchEdit(craftData);
+            let updateSaleRes = { code: 200 };
             let addProductRes = { code: 200 };
-            if (productData.addListMap.length) {
-              addProductRes = await addTableData(productData);
+            //循环修改
+
+            let filteredItems = this.productionTableData.filter(item => 'id' in item);
+            if (filteredItems.length) {
+              filteredItems.forEach(item=>{
+                saleProductsBatchEdit(item).then(re=>{
+                  updateSaleRes = re.data
+                });
+              })
             }
-            // console.log(delRes, updateSaleRes, updateCraftRes, addProductRes);
+            if (productData.addListMap.length > 0) {
+              let filteredItemss = this.productionTableData.filter(item => !('id' in item));
+              productData.addListMap = filteredItemss;
+              if(filteredItemss.length > 0){
+                addProductRes = await addTableData(productData);
+              }
+            }
+            console.log("--------------------------",updateCraftRes,updateSaleRes,addProductRes)
             if (
-              delRes?.code === 200 &&
-              updateSaleRes?.code === 200 &&
-              updateCraftRes?.code === 200 &&
+              updateSaleRes?.code === 200 ||
+              updateCraftRes?.code === 200 ||
               addProductRes?.code === 200
             ) {
               this.$message.success("修改成功");
@@ -2405,7 +2418,7 @@ export default {
             });
             return item;
           });
-
+          console.log(this.productionTableData,"hmc")
           let promiseRes = await Promise.all(promiseArr);
           promiseRes.forEach((item, index) => {
             this.productionTableData[index].specificationsList = item.data;

+ 41 - 40
zkqy-ui/src/views/orderMange/planTable/fangsi.vue

@@ -12,6 +12,7 @@
             <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+            <el-table-column prop="number" label="数量" header-align="center"  width="90px" align="center"></el-table-column>
             <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
           </el-table-column>
@@ -172,7 +173,7 @@
             <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
               <template v-slot:default="scope">
                 <!-- 如果当前行正在编辑,则显示输入框 -->
-                <el-input v-if="scope.row.isEditing" :disabled="false" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+                <el-input v-if="scope.row.isEditing" disabled="disabled" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
                 <!-- 否则显示普通文本 -->
                 <span v-else>{{ scope.row.currentSpecification }}</span>
               </template>
@@ -223,7 +224,7 @@
                 <el-button
                   size="mini"
                   type="danger"
-                  @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">更新状态</el-button>
+                  @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">修改</el-button>
                 <el-button
                   size="mini"
                   type="danger"
@@ -442,35 +443,35 @@ export default {
     },
     // 点击编辑行
     handleRowClick(row) {
-      // this.isEditLine = true;
-      // //找到当前行的编辑索引
-      // var rowIndex = this.tableData2.indexOf(row);
-      // console.log(rowIndex)
-      // if (this.lastEditLine != 0 &&
-      //   this.editingRowIndex !== rowIndex &&
-      //   this.editingRowIndex !== -1 &&
-      //   !this.isRowFilled(this.tableData2[this.lastEditLine])) {
-      //   this.$message({
-      //     message: '请先完成上一条数据的填写',
-      //     type: 'warning'
-      //   });
-      //   return;
-      // }
-      // //编辑索引不等于当前编辑行索引
-      // if (this.editingRowIndex !== rowIndex) {
-      //   // alert(this.editingRowIndex);
-      //   if (this.editingRowIndex !== -1) {
-      //     //把当前行变成不可编辑的
-      //     this.tableData2[this.editingRowIndex].isEditing = false;
-      //   }
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }else {
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }
+      this.isEditLine = true;
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+      console.log(rowIndex)
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }else {
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
 
     },
     // 光标失去焦点变成不可编辑
@@ -700,17 +701,17 @@ export default {
 
       //判断当前计划是否已经投产
       getIsTheOrderProductProduced({"id":row.id}).then(resp=>{
-        if(resp.data.length>0){
-          this.$message({message: '当前计划订单产品在生产中已经不能修改', type: 'warning'});
-
-          return;//证明有在上级的产品--zhi能有一个上级产品
-        }
+        // if(resp.data.length>0){
+        //   this.$message({message: '当前计划订单产品在生产中已经不能修改', type: 'warning'});
+        //
+        //   return;//证明有在上级的产品--zhi能有一个上级产品
+        // }
         //不等于0待机才去校验是否重复
         if(row.planStatus!=0){//上机/停机校验是否重复
-          if(resp.data.length>0){
-            this.$message({message: '当前计划订单产品在生产中已经不能修改', type: 'warning'});
-            return;//证明有在上级的产品--zhi能有一个上级产品
-          }
+          // if(resp.data.length>0){
+          //   this.$message({message: '当前计划订单产品在生产中已经不能修改', type: 'warning'});
+          //   return;//证明有在上级的产品--zhi能有一个上级产品
+          // }
           //先查询计划表中有没有正在上机的或者停机的
           getCurrentProductionLineSuperior({"id":row.id,"macId":row.macId,"planStatus":row.planStatus}).then(response => {
             if(response.data.length>0){

+ 32 - 31
zkqy-ui/src/views/orderMange/planTable/fankuang.vue

@@ -11,6 +11,7 @@
         <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
         <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
         <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+        <el-table-column prop="number" label="数量" header-align="center"  width="90px" align="center"></el-table-column>
         <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
         <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
       </el-table-column>
@@ -171,7 +172,7 @@
         <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
           <template v-slot:default="scope">
             <!-- 如果当前行正在编辑,则显示输入框 -->
-            <el-input v-if="scope.row.isEditing" :disabled="false" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
+            <el-input v-if="scope.row.isEditing" disabled="disabled" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
             <!-- 否则显示普通文本 -->
             <span v-else>{{ scope.row.currentSpecification }}</span>
           </template>
@@ -222,7 +223,7 @@
             <el-button
               size="mini"
               type="danger"
-              @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">更新状态</el-button>
+              @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">确认修改</el-button>
             <el-button
               size="mini"
               type="danger"
@@ -444,35 +445,35 @@ export default {
     },
     // 点击编辑行
     handleRowClick(row) {
-      // this.isEditLine = true;
-      // //找到当前行的编辑索引
-      // var rowIndex = this.tableData2.indexOf(row);
-      // console.log(rowIndex)
-      // if (this.lastEditLine != 0 &&
-      //   this.editingRowIndex !== rowIndex &&
-      //   this.editingRowIndex !== -1 &&
-      //   !this.isRowFilled(this.tableData2[this.lastEditLine])) {
-      //   this.$message({
-      //     message: '请先完成上一条数据的填写',
-      //     type: 'warning'
-      //   });
-      //   return;
-      // }
-      // //编辑索引不等于当前编辑行索引
-      // if (this.editingRowIndex !== rowIndex) {
-      //   // alert(this.editingRowIndex);
-      //   if (this.editingRowIndex !== -1) {
-      //     //把当前行变成不可编辑的
-      //     this.tableData2[this.editingRowIndex].isEditing = false;
-      //   }
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }else {
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }
+      this.isEditLine = true;
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+      console.log(rowIndex)
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }else {
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
 
     },
     // 光标失去焦点变成不可编辑

+ 29 - 28
zkqy-ui/src/views/orderMange/planTable/index.vue

@@ -16,6 +16,7 @@
             <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+            <el-table-column prop="number" label="数量" header-align="center"  width="90px" align="center"></el-table-column>
             <el-table-column prop="currentSpindleCount" label="锭数" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
             <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
@@ -257,7 +258,7 @@
                 <el-button
                   size="mini"
                   type="danger"
-                  @click.stop.prevent="updateStatus(scope.$index, scope.row)">更新状态</el-button>
+                  @click.stop.prevent="updateStatus(scope.$index, scope.row)">确认修改</el-button>
                 <el-button
                   size="mini"
                   type="danger"
@@ -537,7 +538,7 @@
                 <el-button
                   size="mini"
                   type="danger"
-                  @click.stop.prevent="updateStatus(scope.$index, scope.row)">更新状态</el-button>
+                  @click.stop.prevent="updateStatus(scope.$index, scope.row)">确认修改</el-button>
                 <el-button
                   size="mini"
                   type="danger"
@@ -1069,32 +1070,32 @@ export default {
     },
     // 点击编辑行
     handleRowClick(row) {
-      // this.isEditLine = true;
-      // // alert(this.lastEditLine+"编辑行")
-      // //找到当前行的编辑索引
-      // var rowIndex = this.tableData2.indexOf(row);
-      //
-      // if (this.lastEditLine != 0 &&
-      //   this.editingRowIndex !== rowIndex &&
-      //   this.editingRowIndex !== -1 &&
-      //   !this.isRowFilled(this.tableData2[this.lastEditLine])) {
-      //   this.$message({
-      //     message: '请先完成上一条数据的填写',
-      //     type: 'warning'
-      //   });
-      //   return;
-      // }
-      // //编辑索引不等于当前编辑行索引
-      // if (this.editingRowIndex !== rowIndex) {
-      //   // alert(this.editingRowIndex);
-      //   if (this.editingRowIndex !== -1) {
-      //     //把当前行变成不可编辑的
-      //     this.tableData2[this.editingRowIndex].isEditing = false;
-      //   }
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }
+      this.isEditLine = true;
+      // alert(this.lastEditLine+"编辑行")
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
 
     },
     // 光标失去焦点变成不可编辑

+ 31 - 30
zkqy-ui/src/views/orderMange/planTable/luotong.vue

@@ -11,6 +11,7 @@
         <el-table-column prop="currentColorCode" label="色号" header-align="center" width="90px" align="center"></el-table-column>
         <el-table-column prop="currentSpecification" label="规格" header-align="center" width="90px" align="center"></el-table-column>
         <el-table-column prop="currentLotNumber" label="批号" header-align="center"  width="90px" align="center"></el-table-column>
+        <el-table-column prop="number" label="数量" header-align="center"  width="90px" align="center"></el-table-column>
         <el-table-column prop="startTime" label="上机时间" header-align="center" width="90px" align="center"></el-table-column>
         <el-table-column prop="plannedEndTime" label="下机时间" header-align="center" width="90px" align="center"></el-table-column>
       </el-table-column>
@@ -222,7 +223,7 @@
             <el-button
               size="mini"
               type="danger"
-              @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">更新状态</el-button>
+              @click.stop.prevent="updateStatus(scope.$index, scope.row,scope.row.planStatus)">确认修改</el-button>
             <el-button
               size="mini"
               type="danger"
@@ -440,35 +441,35 @@ export default {
     },
     // 点击编辑行
     handleRowClick(row) {
-      // this.isEditLine = true;
-      // //找到当前行的编辑索引
-      // var rowIndex = this.tableData2.indexOf(row);
-      // console.log(rowIndex)
-      // if (this.lastEditLine != 0 &&
-      //   this.editingRowIndex !== rowIndex &&
-      //   this.editingRowIndex !== -1 &&
-      //   !this.isRowFilled(this.tableData2[this.lastEditLine])) {
-      //   this.$message({
-      //     message: '请先完成上一条数据的填写',
-      //     type: 'warning'
-      //   });
-      //   return;
-      // }
-      // //编辑索引不等于当前编辑行索引
-      // if (this.editingRowIndex !== rowIndex) {
-      //   // alert(this.editingRowIndex);
-      //   if (this.editingRowIndex !== -1) {
-      //     //把当前行变成不可编辑的
-      //     this.tableData2[this.editingRowIndex].isEditing = false;
-      //   }
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }else {
-      //   //把当前行变成可编辑的
-      //   row.isEditing = true;
-      //   this.editingRowIndex = rowIndex;
-      // }
+      this.isEditLine = true;
+      //找到当前行的编辑索引
+      var rowIndex = this.tableData2.indexOf(row);
+      console.log(rowIndex)
+      if (this.lastEditLine != 0 &&
+        this.editingRowIndex !== rowIndex &&
+        this.editingRowIndex !== -1 &&
+        !this.isRowFilled(this.tableData2[this.lastEditLine])) {
+        this.$message({
+          message: '请先完成上一条数据的填写',
+          type: 'warning'
+        });
+        return;
+      }
+      //编辑索引不等于当前编辑行索引
+      if (this.editingRowIndex !== rowIndex) {
+        // alert(this.editingRowIndex);
+        if (this.editingRowIndex !== -1) {
+          //把当前行变成不可编辑的
+          this.tableData2[this.editingRowIndex].isEditing = false;
+        }
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }else {
+        //把当前行变成可编辑的
+        row.isEditing = true;
+        this.editingRowIndex = rowIndex;
+      }
 
     },
     // 光标失去焦点变成不可编辑

+ 21 - 41
zkqy-ui/src/views/orderMange/retailMange/index.vue

@@ -289,8 +289,8 @@
           >
             <el-col :span="12">
               <el-form-item prop="saleNo" label="合同号:">
-                <!-- <el-input size="small" v-model="formData.saleNo"></el-input> -->
-                {{ formData.saleNo }}
+<!--                 <el-input size="small" v-model="formData.saleNo"></el-input>-->
+                {{ this.lsaleNo }}
               </el-form-item>
             </el-col>
             <!-- <el-col :span="12">
@@ -867,6 +867,7 @@ export default {
   },
   data() {
     return {
+      lsaleNo:'',//全局添加合同号
       // 提交  表单数据  start
       form: {
         noticeNumber: "", //通知单号
@@ -1167,7 +1168,6 @@ export default {
     },
     // 零售订单完成回调
     async handleComplate(row) {
-      console.log(row);
       let payload = {
         id: row.id,
         status: 6,
@@ -1186,7 +1186,6 @@ export default {
           type: "error",
           message: "订单已完成失败,请稍后再试",
         });
-        console.log(res);
       }
     },
     // 更新库存箱数和重量
@@ -1324,14 +1323,6 @@ export default {
         ).id;
       }
     },
-    // 生成合同号
-    getSaleNo() {
-      let timeStr = moment().format("YYYYMMDD");
-      for (var i = 0; i < 5; i++) {
-        timeStr += parseInt(Math.random() * 10);
-      }
-      return timeStr;
-    },
     // 自定义筛选方法
     mySelectFilter(value, row) {
       console.log(value);
@@ -1393,12 +1384,20 @@ export default {
       )?.productType;
       this.productionOptions = this.allProductionOptions.slice(0, 500);
     },
-
+// 生成合同号
+    getSaleNo() {
+      let timeStr = moment().format("YYYYMMDD");
+      for (var i = 0; i < 5; i++) {
+        timeStr += parseInt(Math.random() * 10);
+      }
+      console.log("生成合同号==============",timeStr)
+      return timeStr;
+    },
     // 重置审计表单数据
     resetFormData() {
       Object.assign(this.formData, {
         //订单表数据
-        saleNo: this.getSaleNo(), //合同号
+        saleNo: "", //合同号
         saleCustomNo: "", //客户编号
         saleDate: moment(new Date()).format("YYYY-MM-DD"), //销售单日期
         saleOrderEstimatedTime: moment(new Date()).format("YYYY-MM-DD"), //预计下单时间
@@ -1626,8 +1625,12 @@ export default {
         this.createById = this.userInfo.userId;
       }
       await this.getRoleUser();
+      this.formData.saleNo ='';
+      this.lsaleNo = '';
       this.resetFormData();
-
+      this.lsaleNo =this.getSaleNo();
+      this.formData.saleNo = this.lsaleNo;
+      console.log("赋值合同号==============",this.formData.saleNo)
       this.title = "新增零售单";
       this.open = true;
       this.$nextTick(() => {
@@ -1831,8 +1834,6 @@ export default {
       // }
       this.$refs.formDataRef.validate(async (valid) => {
         if (valid) {
-          console.log(valid);
-
           let {
             id,
             //订单表数据
@@ -1881,7 +1882,7 @@ export default {
           this.form.drawer = this.username;
           this.form.documentType = "1";
           this.form.billingType = "1";
-          this.form.saleOrderNo = saleNo;
+          this.form.saleOrderNo = this.lsaleNo;
           this.form.dispatchNoteRemark = orderRemark;
           this.form.customerId = this.customerOptions.find(
             (item) => item.customNo == saleCustomNo
@@ -1902,6 +1903,7 @@ export default {
           } else {
             //新增
             payload.orderType = 1;
+            payload.saleNo = this.lsaleNo;
             let res = await addRetailOrder(payload);
             if (res.code == 200) {
               // 准备新增时 提交  数据 start
@@ -1961,7 +1963,6 @@ export default {
     },
     // 审计   编辑回调
     async handleEdit(index, row) {
-      console.log(row);
       let { saleOrderSaleNo } = row;
       try {
         let payLoad = [
@@ -2077,11 +2078,6 @@ export default {
     // 计算金额
     computedPrice(row) {
       let { productNumber, productUnitPrice } = row;
-      console.log(
-        "productNumber, productUnitPrice",
-        productNumber,
-        productUnitPrice
-      );
       row.productAmounts = (
         Number(productNumber) * Number(productUnitPrice)
       ).toFixed(2);
@@ -2132,7 +2128,6 @@ export default {
     // 处理列表信息
     columnsHandler(columns) {
       let resArr = [];
-      console.log(columns, 111);
       columns.forEach((item) => {
         for (const key in item) {
           let tempObj = {};
@@ -2141,7 +2136,6 @@ export default {
           resArr.push(tempObj);
         }
       });
-      console.log(resArr, 222);
       return resArr;
     },
     // 取消按钮
@@ -2178,7 +2172,6 @@ export default {
       // );
       this.selection = selection;
       this.myDelIds = selection.map((item) => item.id);
-      console.log(this.myDelIds);
       this.ids = selection.map((item) => item.saleOrderSaleNo);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
@@ -2374,7 +2367,6 @@ export default {
     },
     /** 修改按钮操作 */
     async handleUpdate(row) {
-      console.log(row);
       this.isEdit = true;
       await this.getDropDownData();
       this.isLeader = !this.userInfo.roles.includes("salesman");
@@ -2385,8 +2377,8 @@ export default {
       this.title = "修改零售单";
       try {
         let res = await getRetailOrderInfo(row.id);
-        console.log(res);
         if (res.code == 200) {
+          this.lsaleNo = res.data.saleNo;
           this.initData(res.data);
           this.open = true;
         } else {
@@ -2406,7 +2398,6 @@ export default {
       await this.getRoleUser();
       try {
         let res = await getRetailOrderInfo(row.id);
-        console.log(res);
         if (res.code == 200) {
           await this.initData(res.data);
           this.printDomData = this.getPrintDom(res.data);
@@ -2430,7 +2421,6 @@ export default {
     },
     // 取消提交
     async handleSubmitCancel(row) {
-      console.log(row);
       this.$confirm("此操作将撤回该次提交, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -2453,7 +2443,6 @@ export default {
               this.getList();
             } else {
               this.$message.error("取消失败");
-              console.log(res);
             }
           } catch (error) {
             console.log(error);
@@ -2488,7 +2477,6 @@ export default {
         // 工艺表数据
         orderRemark,
       } = this.formData;
-      console.log(this.form, this.productionTableData);
       let { truckRegistration } = this.form;
       let customData = this.customerOptions.find(
         (item) => item.customNo == saleCustomNo
@@ -2940,7 +2928,6 @@ export default {
             this.kOpen = false;
           })
           .catch((res) => {
-            console.log(res);
             this.$modal.msgError("表单校验失败,请规范填写数据");
           });
       } else {
@@ -3046,7 +3033,6 @@ export default {
 
     // 设置表格字段样式
     async setFieldStyleData(tableList) {
-      console.log(JSON.parse(JSON.stringify(tableList)));
       let fieldConditionList = this.styleList.filter(
         (item) => item.styleType == 1 || item.styleType == 2
       );
@@ -3230,7 +3216,6 @@ export default {
       ];
       let res = await queryDropDownBoxData(payLoad);
       if (res.code == 200) {
-        console.log(res);
         let { sale_craft, sale_order, sale_products } = res.data.resultMap;
         let {
           //订单表数据
@@ -3341,7 +3326,6 @@ export default {
           let productData = this.productionOptions.find(
             (pro) => pro.productNo == item.productNo
           );
-          console.log("item", item);
           item.sliceTypeLabel =
             this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
               ?.materielName || "";
@@ -3465,13 +3449,10 @@ export default {
     },
     // 自定义删除按钮
     async myDeleteHandler(row) {
-      console.log(row);
       let stateArr = ["6"];
       let isDeleteValidate = this.selection.some((item) => {
         return stateArr.includes(item.status);
       });
-      console.log(this.selection);
-      console.log(isDeleteValidate);
       if (isDeleteValidate) {
         this.$message.error("'已完成'状态订单不可删除!");
         return;
@@ -3483,7 +3464,6 @@ export default {
       });
       let payLoad = row.id ? [row.id] : this.myDelIds;
       payLoad = payLoad.join(",");
-      console.log(payLoad);
 
       try {
         let res = await deleRetailOrder(payLoad);