Selaa lähdekoodia

feat:排产排过的不让他拍

hmc 11 kuukautta sitten
vanhempi
säilyke
e15625f6af

+ 12 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/controller/MaterielController.java

@@ -57,10 +57,19 @@ public class MaterielController extends BaseController
 //    //@PreAuthorize("@ss.hasPermi('system:materiel:list')")
     @GetMapping("/getMaterielInfo")
     @ApiOperation(value = "查询物料信息列表")
-    public AjaxResult getMaterielInfo(@RequestParam("materielCode") String materielCode)
+    public AjaxResult getMaterielInfo(
+            @RequestParam(value = "materielCode",required = false) String materielCode,
+            @RequestParam(value = "materielSpecies",required = false) String materielSpecies
+    )
     {
-        Materiel materiel = materielService.selectMateriel(materielCode);
-        return AjaxResult.success(materiel);
+//      Materiel materiel = materielService.selectMateriel(materielCode);
+//      List<Materiel> materiels = materielService.selectMateriel(materielCode);
+        Materiel materiel=new Materiel();
+        materiel.setMaterielSpecies(materielSpecies);
+        materiel.setDelFlag("0");
+        materiel.setMaterielCode(materielCode);
+        List<Materiel> materiels = materielService.selectMaterielList(materiel);
+        return AjaxResult.success(materiels);
     }
 
     /**

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/controller/SaleProductsController.java

@@ -48,7 +48,7 @@ public class SaleProductsController extends BaseController {
         //销售单什么状态为3的(待生产)
         SaleProducts saleProducts=new SaleProducts();
 //        saleProducts.setStatus("3");
-//        saleProducts.setProductionLineNo(productionLineNo); //不查在当前产线投产过的产品了
+        saleProducts.setProductionLineNo(productionLineNo); //不查在当前产线投产过的产品了
         List<SaleProductsVo> list = saleProductsService.selectSaleProductsListAndCustomerName(saleProducts);
 
         return AjaxResult.success(list);

+ 13 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/DetailsOfTheRefuelingPlan.java

@@ -91,6 +91,19 @@ public class DetailsOfTheRefuelingPlan extends BaseEntity
     @Excel(name = "产品类型")
     private String productType;
 
+
+    /** 产品类型 */
+    @Excel(name = "色号编码")
+    private String  colourNumber;
+
+
+    public String getColourNumber() {
+        return colourNumber;
+    }
+
+    public void setColourNumber(String colourNumber) {
+        this.colourNumber = colourNumber;
+    }
     public String getPlanStatusOld() {
         return planStatusOld;
     }

+ 11 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/domain/DetailsOfTheRefuelingPlanSpinning.java

@@ -90,6 +90,17 @@ public class DetailsOfTheRefuelingPlanSpinning extends BaseEntity
     @Excel
     private  String  planType;
 
+    @Excel(name = "色号编码")
+    private String  colourNumber;
+
+    public String getColourNumber() {
+        return colourNumber;
+    }
+
+    public void setColourNumber(String colourNumber) {
+        this.colourNumber = colourNumber;
+    }
+
     public Long getId() {
         return id;
     }

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/MaterielMapper.java

@@ -27,7 +27,7 @@ public interface MaterielMapper
      * @param materielCode 物料编码
      * @return 物料信息
      */
-    public Materiel selectMaterielByMaterielCode(String materielCode);
+    public List<Materiel> selectMaterielByMaterielCode(String materielCode);
 
     /**
      * 查询物料信息列表

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/IMaterielService.java

@@ -32,7 +32,7 @@ public interface IMaterielService
      * @param materielCode
      * @return
      */
-    public Materiel selectMateriel(String materielCode);
+    public List<Materiel> selectMateriel(String materielCode);
 
 
     /**

+ 3 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanSpinningServiceImpl.java

@@ -295,8 +295,11 @@ public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfT
             saleProducts.setId(Long.valueOf(item.getProductId()));
             saleProducts.setProductionLineNo(item.getMacId());//产线iD
             saleProducts.setLotNumber(item.getCurrentLotNumber().toString());//批号
+            saleProducts.setColourNumber(item.getColourNumber());
             //产品对应的信息
             SaleProducts saleProducts1 = saleProductsMapper.selectSaleProductsById(Long.valueOf(item.getProductId()));
+            saleProducts.setTaskName(saleProducts1.getProductName()+item.getCurrentColorCode());
+            //产品对应的信息
             item.setProductTypeName(saleProducts1.getProductName());
             saleProductsList.add(saleProducts);
             if(item.getPlanStatus().equals("1")){
@@ -320,7 +323,6 @@ public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfT
             //更新产线
             int i3= saleProductsMapper.updateSaleProductBatch(saleProductsList2);
         }
-
         return detailsOfTheRefuelingPlanSpinningMapper.insertBatchDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning);
     }
     @Override

+ 1 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/MaterielServiceImpl.java

@@ -54,7 +54,7 @@ public class MaterielServiceImpl implements IMaterielService
     }
 
     @Override
-    public Materiel selectMateriel(String materielCode) {
+    public List<Materiel> selectMateriel(String materielCode) {
         return materielMapper.selectMaterielByMaterielCode(materielCode);
     }
 

+ 4 - 2
zkqy-custom-business/src/main/resources/mapper/business/MaterielMapper.xml

@@ -60,9 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectMaterielVo"/>
         where id = #{id}
     </select>
-    <select id="selectMaterielByMaterielCode" resultType="com.zkqy.business.domain.Materiel">
+    <select id="selectMaterielByMaterielCode" resultMap="MaterielResult">
         <include refid="selectMaterielVo"/>
-        where materiel_code = #{materielCode}
+        where del_flag = '0'
+        <if test="materielSpecies != null  and materielSpecies != ''"> and materiel_species = #{materielSpecies}</if>
+        <if test="materielCode != null  and materielCode != ''"> and materiel_code = #{materielCode}</if>
     </select>
 
     <insert id="insertMateriel" parameterType="com.zkqy.business.domain.Materiel" useGeneratedKeys="true" keyProperty="id">

+ 7 - 9
zkqy-custom-business/src/main/resources/mapper/business/SaleProductsMapper.xml

@@ -133,21 +133,20 @@
     <select id="selectSaleProductsListAndCustomInfo" parameterType="com.zkqy.business.domain.SaleProducts"
             resultMap="SaleProductsResultAndCustomInfo">
         SELECT
-        sp.*,cs.custom_name,m.materie_encoding,m.materie_color_number,pd.product_specifications
+        sp.*,cs.custom_name,pd.product_specifications,sp.colours,
+        pl.production_line_no as ccc
         FROM
         {DBNAME}.sale_products AS sp
         INNER JOIN {DBNAME}.sale_order AS so ON sp.sale_order_no = so.sale_no
         Inner Join {DBNAME}.customer as cs ON so.sale_custom_no= cs.custom_no
-        inner join {DBNAME}.materiel as m on sp.colour_number= m.materiel_code
         inner join {DBNAME}.production as pd on sp.product_no= pd.product_no
         left join {DBNAME}.production_line as pl on sp.production_line_no=pl.id
-        where sp.del_flag = '0' and cs.del_flag = '0' and m.del_flag = '0' and so.order_type=2 and (sp.status=3 or
-        sp.status=4 or sp.status=5) and sp.status!=6
+        where sp.del_flag = '0' and cs.del_flag = '0'
+        AND so.order_type = 2 and so.`status`in (3,4) and sp.`status` in (3,4,6)
         <if test="saleProductNo != null  and saleProductNo != ''">and sale_product_no = #{saleProductNo}</if>
         <if test="saleOrderNo != null  and saleOrderNo != ''">and sale_order_no = #{saleOrderNo}</if>
         <if test="productNo != null  and productNo != ''">and product_no = #{productNo}</if>
-        <if test="productName != null  and productName != ''">and product_name like concat('%', #{productName}, '%')
-        </if>
+        <if test="productName != null  and productName != ''">and product_name like concat('%', #{productName}, '%')</if>
         <if test="productNumber != null ">and product_number = #{productNumber}</if>
         <if test="productWeight != null  and productWeight != ''">and product_weight = #{productWeight}</if>
         <if test="productUnitPrice != null  and productUnitPrice != ''">and product_unit_price = #{productUnitPrice}
@@ -159,9 +158,8 @@
         <if test="taskProcessKey != null  and taskProcessKey != ''">and task_process_key = #{taskProcessKey}</if>
         <if test="taskNodeKey != null  and taskNodeKey != ''">and task_node_key = #{taskNodeKey}</if>
         <if test="processKey != null  and processKey != ''">and process_key = #{processKey}</if>
-        <if test="status != null  and status != ''">and sp.status = #{status}</if>
-        <!--            <if test="productionLineNo != null  and productionLineNo != ''"> AND sp.production_line_no IS NULL or sp.status =3 and pl.production_line_no NOT lIKE CONCAT(#{productionLineNo}, '%' )</if>-->
-
+        <if test="status != null  and status != ''">and sp.status=3</if>
+        <if test="productionLineNo != null  and productionLineNo != ''">and (pl.production_line_no NOT lIKE CONCAT(#{productionLineNo}, '%' )  or pl.production_line_no is null)</if>
         <if test="sliceType != null  and sliceType != ''">and slice_type = #{sliceType}</if>
         <if test="colourNumber != null  and colourNumber != ''">and colour_number = #{colourNumber}</if>
         <if test="lotNumber != null  and lotNumber != ''">and lot_number = #{lotNumber}</if>

+ 50 - 10
zkqy-ui/src/views/orderMange/planTable/fangsi.vue

@@ -57,10 +57,18 @@
 
             <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
               <template v-slot:default="scope">
-                <!-- 如果当前行正在编辑,则显示输入框 -->
-                <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
-                <!-- 否则显示普通文本 -->
-                <span v-else>{{ scope.row.currentColorCode }}</span>
+                <el-select v-model="scope.row.currentColorCode" filterable placeholder="请选择母粒编码" @change="selectedML(scope.row)">
+                  <el-option
+                    v-for="(item,index) in options"
+                    :key="index"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+<!--                &lt;!&ndash; 如果当前行正在编辑,则显示输入框 &ndash;&gt;-->
+<!--                <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>-->
+<!--                &lt;!&ndash; 否则显示普通文本 &ndash;&gt;-->
+<!--                <span v-else>{{ scope.row.currentColorCode }}</span>-->
               </template>
             </el-table-column>
             <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
@@ -246,6 +254,7 @@ import {
 export default {
   data() {
     return {
+      options: [],
       //
       isDisabled:true,
       //选中的是那个车间
@@ -298,6 +307,15 @@ export default {
     this.getSpinningPlanList();
   },
   methods: {
+    selectedML(row){
+      console.log(row.currentColorCode)
+      if(row.currentColorCode){
+        let tarName=this.options.find(item=>item.value==row.currentColorCode).colourNumber
+        console.log("aaaaa=============",tarName)
+        row.colourNumber=tarName;
+        console.log("aaaaa=============",row)
+      }
+    },
     getProductChineseName(productId) {
       return  this.productsInfo.find(product => product.id == productId).productName;
     },
@@ -343,7 +361,8 @@ export default {
       getProductsInfo("FS-").then((response) => {
         this.productsInfo = response.data;
         this.productsInfo.forEach(item => {
-          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          // item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          item.productName = item.productName+"—"+item.colours;
         });
       })
     },
@@ -354,16 +373,36 @@ export default {
       //得到选择的商品
       this.form.product=selectedProduct;
       //通过母粒编码查询到对应的母粒信息
+      // let queryParams = {
+      //   "materielCode": this.product.colourNumber
+      // }
       let queryParams = {
-        "materielCode": this.product.colourNumber
+        // "materielCode": this.product.colourNumber,
+        "materielSpecies":"1"
       }
       //得到对应的母粒信息
+      // getMaterielInfo(queryParams).then((response) => {
+      //   if (response.data!=null) {
+      //     this.materiel = response.data;
+      //     console.log(response.data,"规格")
+      //     //色号 母粒编码+色号
+      //     row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+      //   }
+      // });
+      //得到对应的母粒信息
       getMaterielInfo(queryParams).then((response) => {
         if (response.data!=null) {
-          this.materiel = response.data;
-          console.log(response.data,"规格")
+          let mls = response.data
+          mls.forEach(dataKey => {
+            this.options.push({
+              "label":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "value":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "colourNumber":dataKey.materielCode
+            })
+          });
+          // row.aa="d"
           //色号 母粒编码+色号
-          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          // row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
         }
       });
       //isDisabled(有批号就用,没批号就自己输入)
@@ -494,7 +533,8 @@ export default {
         productId:'',
         salesmanId:'',
         isEditing: true, // 标记为正在编辑状态
-        planType:"纺丝计划"
+        planType:"纺丝计划",
+        colourNumber:""//色号编码
       });
       this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
       this.lastEditLine = this.tableData2.length - 1

+ 53 - 10
zkqy-ui/src/views/orderMange/planTable/fankuang.vue

@@ -56,10 +56,18 @@
 
         <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
           <template v-slot:default="scope">
-            <!-- 如果当前行正在编辑,则显示输入框 -->
-            <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
-            <!-- 否则显示普通文本 -->
-            <span v-else>{{ scope.row.currentColorCode }}</span>
+            <el-select v-model="scope.row.currentColorCode" filterable placeholder="请选择母粒编码" @change="selectedML(scope.row)">
+              <el-option
+                v-for="(item,index) in options"
+                :key="index"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+<!--            &lt;!&ndash; 如果当前行正在编辑,则显示输入框 &ndash;&gt;-->
+<!--            <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>-->
+<!--            &lt;!&ndash; 否则显示普通文本 &ndash;&gt;-->
+<!--            <span v-else>{{ scope.row.currentColorCode }}</span>-->
           </template>
         </el-table-column>
         <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
@@ -245,6 +253,7 @@ import {
 export default {
   data() {
     return {
+      options: [],
       //
       isDisabled:true,
       //选中的是那个车间
@@ -297,6 +306,15 @@ export default {
     this.getSpinningPlanList();
   },
   methods: {
+    selectedML(row){
+      console.log(row.currentColorCode)
+      if(row.currentColorCode){
+        let tarName=this.options.find(item=>item.value==row.currentColorCode).colourNumber
+        console.log("aaaaa=============",tarName)
+        row.colourNumber=tarName;
+        console.log("aaaaa=============",row)
+      }
+    },
     getProductChineseName(productId) {
       return  this.productsInfo.find(product => product.id == productId).productName;
     },
@@ -342,7 +360,8 @@ export default {
       getProductsInfo("FK-").then((response) => {
         this.productsInfo = response.data;
         this.productsInfo.forEach(item => {
-          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          // item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          item.productName = item.productName+"—"+item.colours;
         });
       })
     },
@@ -353,18 +372,41 @@ export default {
       //得到选择的商品
       this.form.product=selectedProduct;
       //通过母粒编码查询到对应的母粒信息
+      // let queryParams = {
+      //   "materielCode": this.product.colourNumber
+      // }
+      // //得到对应的母粒信息
+      // getMaterielInfo(queryParams).then((response) => {
+      //   if (response.data!=null) {
+      //     this.materiel = response.data;
+      //     console.log(response.data,"规格")
+      //     //色号 母粒编码+色号
+      //     row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+      //   }
+      // });
+
+      //7月10号新需求修改
+      //通过母粒编码查询到对应的母粒信息
       let queryParams = {
-        "materielCode": this.product.colourNumber
+        // "materielCode": this.product.colourNumber,
+        "materielSpecies":"1"
       }
       //得到对应的母粒信息
       getMaterielInfo(queryParams).then((response) => {
         if (response.data!=null) {
-          this.materiel = response.data;
-          console.log(response.data,"规格")
+          let mls = response.data
+          mls.forEach(dataKey => {
+            this.options.push({
+              "label":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "value":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "colourNumber":dataKey.materielCode
+            })
+          });
           //色号 母粒编码+色号
-          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          // row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
         }
       });
+
       //isDisabled(有批号就用,没批号就自己输入)
       if(this.product.lotNumber!=undefined&&this.product.lotNumber!=""){
         row.currentLotNumber=this.product.lotNumber;
@@ -494,7 +536,8 @@ export default {
         productId:'',
         salesmanId:'',
         isEditing: true, // 标记为正在编辑状态
-        planType:"翻框计划"
+        planType:"翻框计划",
+        colourNumber:""
       });
       this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
       this.lastEditLine = this.tableData2.length - 1

+ 51 - 14
zkqy-ui/src/views/orderMange/planTable/index.vue

@@ -64,10 +64,18 @@
             </el-table-column>
             <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
               <template v-slot:default="scope">
-                <!-- 如果当前行正在编辑,则显示输入框 -->
-                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
-                <!-- 否则显示普通文本 -->
-                <span v-else>{{ scope.row.currentColorCode }}</span>
+                <el-select v-model="scope.row.currentColorCode" filterable placeholder="请选择母粒编码" @change="selectedML(scope.row)">
+                  <el-option
+                    v-for="(item,index) in options"
+                    :key="index"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+                <!--                &lt;!&ndash; 如果当前行正在编辑,则显示输入框 &ndash;&gt;-->
+<!--                <el-input v-if="scope.row.isEditing"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>-->
+<!--                &lt;!&ndash; 否则显示普通文本 &ndash;&gt;-->
+<!--                <span v-else>{{ scope.row.currentColorCode }}</span>-->
               </template>
             </el-table-column>
             <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
@@ -331,10 +339,18 @@
             </el-table-column>
             <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
               <template v-slot:default="scope">
-                <!-- 如果当前行正在编辑,则显示输入框 -->
-                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
-                <!-- 否则显示普通文本 -->
-                <span v-else>{{ scope.row.currentColorCode }}</span>
+                <el-select v-model="scope.row.currentColorCode" filterable placeholder="请选择母粒编码">
+                  <el-option
+                    v-for="item in options"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+<!--                &lt;!&ndash; 如果当前行正在编辑,则显示输入框 &ndash;&gt;-->
+<!--                <el-input v-if="scope.row.isEditing"  disabled="disabled"  v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>-->
+<!--                &lt;!&ndash; 否则显示普通文本 &ndash;&gt;-->
+<!--                <span v-else>{{ scope.row.currentColorCode }}</span>-->
               </template>
             </el-table-column>
             <el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
@@ -571,6 +587,7 @@ import {
 export default {
   data() {
     return {
+      options: [],
       modifyMachineStatusFrom:{
         type: [],
       },
@@ -636,6 +653,15 @@ export default {
     getProductChineseName(productId) {
       return  this.productsInfo.find(product => product.id == productId).productName;
     },
+    selectedML(row){
+      console.log(row.currentColorCode)
+      if(row.currentColorCode){
+         let tarName=this.options.find(item=>item.value==row.currentColorCode).colourNumber
+        console.log("aaaaa=============",tarName)
+         row.colourNumber=tarName;
+        console.log("aaaaa=============",row)
+      }
+    },
     //删除计划
     deletePlan($index,row){
       console.log(row)
@@ -929,26 +955,37 @@ export default {
     getProductsInfo() {
       getProductsInfo("JT-").then((response) => {
         this.productsInfo = response.data;
+        console.log("hmcxzz",this.productsInfo)
         this.productsInfo.forEach(item => {
-          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+         // item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          item.productName = item.productName+"—"+item.colours;
         });
       })
     },
     // 下拉框数据改变查询色号批号信息
     selectedChangeDate(row,selectedProduct) {
+      this.options=[];
       //选择的那个销售产品
       this.product = this.productsInfo.find(product => product.id === selectedProduct);
       this.form.product=selectedProduct;
       //通过母粒编码查询到对应的母粒信息
       let queryParams = {
-        "materielCode": this.product.colourNumber
+        // "materielCode": this.product.colourNumber,
+        "materielSpecies":"1"
       }
       //得到对应的母粒信息
       getMaterielInfo(queryParams).then((response) => {
         if (response.data!=null) {
-          this.materiel = response.data;
+          let mls = response.data
+          mls.forEach(dataKey => {
+            this.options.push({
+              "label":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "value":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "colourNumber":dataKey.materielCode
+            })
+          });
           //色号 母粒编码+色号
-          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          // row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
         }
       });
       //isDisabled(有批号就用,没批号就自己输入)
@@ -1108,8 +1145,8 @@ export default {
         planStatus:0,
         productId:'',
         salesmanId:'',
-        isEditing: true // 标记为正在编辑状态
-
+        isEditing: true, // 标记为正在编辑状态
+        colourNumber:""
       });
       this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
       this.lastEditLine = this.tableData2.length - 1

+ 49 - 10
zkqy-ui/src/views/orderMange/planTable/luotong.vue

@@ -56,10 +56,18 @@
 
         <el-table-column prop="currentColorCode" label="色号" header-align="center" align="center">
           <template v-slot:default="scope">
-            <!-- 如果当前行正在编辑,则显示输入框 -->
-            <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>
-            <!-- 否则显示普通文本 -->
-            <span v-else>{{ scope.row.currentColorCode }}</span>
+            <el-select v-model="scope.row.currentColorCode" filterable placeholder="请选择母粒编码" @change="selectedML(scope.row)">
+              <el-option
+                v-for="(item,index) in options"
+                :key="index"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+<!--            &lt;!&ndash; 如果当前行正在编辑,则显示输入框 &ndash;&gt;-->
+<!--            <el-input v-if="scope.row.isEditing"  disabled="disabled"   v-model="scope.row.currentColorCode" placeholder="请输入色号" @blur.stop.prevent="handleInputBlur(scope.row)" ></el-input>-->
+<!--            &lt;!&ndash; 否则显示普通文本 &ndash;&gt;-->
+<!--            <span v-else>{{ scope.row.currentColorCode }}</span>-->
           </template>
         </el-table-column>
         <el-table-column prop="productionDigit" label="生产位数" header-align="center" align="center">
@@ -245,6 +253,7 @@ import {
 export default {
   data() {
     return {
+      options: [],
       //
       isDisabled:true,
       //选中的是那个车间
@@ -297,6 +306,15 @@ export default {
     this.getSpinningPlanList();
   },
   methods: {
+    selectedML(row){
+      console.log(row.currentColorCode)
+      if(row.currentColorCode){
+        let tarName=this.options.find(item=>item.value==row.currentColorCode).colourNumber
+        console.log("aaaaa=============",tarName)
+        row.colourNumber=tarName;
+        console.log("aaaaa=============",row)
+      }
+    },
     getProductChineseName(productId) {
       return  this.productsInfo.find(product => product.id == productId).productName;
     },
@@ -342,7 +360,8 @@ export default {
       getProductsInfo("LT-").then((response) => {
         this.productsInfo = response.data;
         this.productsInfo.forEach(item => {
-          item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          // item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
+          item.productName = item.productName+"—"+item.colours;
         });
       })
     },
@@ -353,16 +372,35 @@ export default {
       //得到选择的商品
       this.form.product=selectedProduct;
       //通过母粒编码查询到对应的母粒信息
+      // let queryParams = {
+      //   "materielCode": this.product.colourNumber
+      // }
+      // //得到对应的母粒信息
+      // getMaterielInfo(queryParams).then((response) => {
+      //   if (response.data!=null) {
+      //     this.materiel = response.data;
+      //     console.log(response.data,"规格")
+      //     //色号 母粒编码+色号
+      //     row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+      //   }
+      // });
       let queryParams = {
-        "materielCode": this.product.colourNumber
+        // "materielCode": this.product.colourNumber,
+        "materielSpecies":"1"
       }
       //得到对应的母粒信息
       getMaterielInfo(queryParams).then((response) => {
         if (response.data!=null) {
-          this.materiel = response.data;
-          console.log(response.data,"规格")
+          let mls = response.data
+          mls.forEach(dataKey => {
+            this.options.push({
+              "label":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "value":dataKey.materieEncoding+"("+dataKey.materieColorNumber+")",
+              "colourNumber":dataKey.materielCode
+            })
+          });
           //色号 母粒编码+色号
-          row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
+          // row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
         }
       });
       //isDisabled(有批号就用,没批号就自己输入)
@@ -494,7 +532,8 @@ export default {
         productId:'',
         salesmanId:'',
         isEditing: true, // 标记为正在编辑状态
-        planType:"络筒计划"
+        planType:"络筒计划",
+        colourNumber:"",
       });
       this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
       this.lastEditLine = this.tableData2.length - 1