Selaa lähdekoodia

部分新需求更改

cz 1 vuosi sitten
vanhempi
commit
74fc6cbf46

+ 45 - 26
src/components/process/SF/Contract.vue

@@ -216,7 +216,7 @@
                       </template>
                     </el-table-column>
                     <el-table-column prop="productCode" label="物料编码" width="190" />
-                    <el-table-column prop="productName" label="物料名称" min-width="200" />
+                    <el-table-column prop="productName" label="物料名称" width="170" />
                     <el-table-column label="规格尺寸 (cm)" width="130">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
@@ -224,6 +224,9 @@
                         </div>
                       </template>
                     </el-table-column>
+                    <el-table-column prop="productColor" label="颜色" width="170" />
+                    <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                    <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
                     <el-table-column prop="quantity" label="数量" width="130">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
@@ -231,7 +234,7 @@
                                         :prop="'contractProductList.' + scope.$index + '.contractProductBomList.' + $index + '.quantity'"
                                         :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
                             <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                             :controls="false" :min="1" />
+                                             :controls="false" :min="1" disabled />
                           </el-form-item>
                           <span v-else>{{row.quantity}}</span>
                         </div>
@@ -252,7 +255,7 @@
                         </div>
                       </template>
                     </el-table-column> -->
-                    <el-table-column prop="remark" label="备注" width="180">
+                    <!-- <el-table-column prop="remark" label="备注" width="180">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="isEditList" :inline-message="true" class="margin-b-0 wid100">
@@ -261,12 +264,13 @@
                           <span v-else>{{row.remark}}</span>
                         </div>
                       </template>
-                    </el-table-column>
-                    <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
+                    </el-table-column> -->
+                    <el-table-column prop="remark" label="备注" min-width="180" />
+                    <!-- <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
                       <template #default="{ row,$index }">
                         <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
                       </template>
-                    </el-table-column>
+                    </el-table-column> -->
                   </el-table>
                 </div>
               </template>
@@ -399,7 +403,7 @@
                   <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                     :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
+                                     :controls="false" :min="0" @change="calculationAmount(true)" v-if="isEditList" />
                     <div v-else> {{row.quantity}}</div>
                   </el-form-item>
                 </div>
@@ -488,9 +492,9 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
+            <el-table-column label="操作" width="80" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
               <template #default="{ $index }">
-                <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材/配件/辅材</el-button>
+                <!-- <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材/配件/辅材</el-button> -->
                 <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
             </el-table-column>
@@ -1661,21 +1665,27 @@ const selectProduct = async (goods) => {
     }
     proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
       if (res.productBomDetailList && res.productBomDetailList.length > 0) {
-        contractProductBomList.value = res.productBomDetailList.map((x) => ({
-          fileUrl: "",
-          materialId: x.materialId,
-          productName: x.materialName,
-          productCode: x.materialCode,
-          productLength: x.materialLength,
-          productWidth: x.materialWidth,
-          productHeight: x.materialHeight,
-          quantity: x.quantity || null,
-          allQuantity: "",
-          price: x.materialPrice || null,
-          amount: "",
-          fileList: [],
-          type: x.type,
-        }));
+        contractProductBomList.value = res.productBomDetailList
+          .filter((x) => x.type != 3)
+          .map((x) => ({
+            fileUrl: "",
+            materialId: x.materialId,
+            productName: x.materialName,
+            productCode: x.materialCode,
+            productLength: x.materialLength,
+            productWidth: x.materialWidth,
+            productHeight: x.materialHeight,
+            productColor: x.materialColor,
+            standardDosage: x.standardDosage,
+            lossRate: x.lossRate,
+            remark: x.remark || "",
+            quantity: null,
+            allQuantity: "",
+            price: x.materialPrice || null,
+            amount: "",
+            fileList: [],
+            type: x.type,
+          }));
         let fileListOne = [];
         if (allFile && allFile.length > 0) {
           fileListOne = allFile.filter((x) => x.businessType == "2");
@@ -1820,7 +1830,7 @@ const handleDeleteMaterial = (index, sonIndex) => {
   );
 };
 
-const calculationAmount = () => {
+const calculationAmount = (flag = flase) => {
   if (
     formData.data.contractProductList &&
     formData.data.contractProductList.length > 0
@@ -1834,6 +1844,15 @@ const calculationAmount = () => {
         Number(formData.data.contractProductList[i].quantity) *
           Number(formData.data.contractProductList[i].factoryPrice)
       ).toFixed(2);
+      let row = formData.data.contractProductList[i];
+      if (flag) {
+        for (let j = 0; j < row.contractProductBomList.length; j++) {
+          let jrow = row.contractProductBomList[j];
+          jrow.quantity = Math.ceil(
+            (row.quantity / jrow.standardDosage) * (1 + jrow.lossRate / 100)
+          );
+        }
+      }
     }
   }
   totalAmount();
@@ -2253,7 +2272,7 @@ const getAllData = (businessId) => {
         });
       changeProductPrice();
     }
-    calculationAmount();
+    calculationAmount(true);
     if (formData.data.countryId) {
       getCityData(formData.data.countryId, "20");
     }

+ 46 - 26
src/components/process/SF/ContractChange.vue

@@ -216,7 +216,7 @@
                       </template>
                     </el-table-column>
                     <el-table-column prop="productCode" label="物料编码" width="190" />
-                    <el-table-column prop="productName" label="物料名称" min-width="200" />
+                    <el-table-column prop="productName" label="物料名称" width="170" />
                     <el-table-column label="规格尺寸 (cm)" width="130">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
@@ -224,6 +224,9 @@
                         </div>
                       </template>
                     </el-table-column>
+                    <el-table-column prop="productColor" label="颜色" width="170" />
+                    <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                    <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
                     <el-table-column prop="quantity" label="数量" width="130">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
@@ -231,7 +234,7 @@
                                         :prop="'contractProductList.' + scope.$index + '.contractProductBomList.' + $index + '.quantity'"
                                         :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
                             <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                             :controls="false" :min="1" />
+                                             :controls="false" :min="1" disabled />
                           </el-form-item>
                           <span v-else>{{row.quantity}}</span>
                         </div>
@@ -252,7 +255,7 @@
                         </div>
                       </template>
                     </el-table-column> -->
-                    <el-table-column prop="remark" label="备注" width="180">
+                    <!-- <el-table-column prop="remark" label="备注" width="180">
                       <template #default="{ row, $index }">
                         <div style="width: 100%">
                           <el-form-item v-if="isEditList" :inline-message="true" class="margin-b-0 wid100">
@@ -261,12 +264,13 @@
                           <span v-else>{{row.remark}}</span>
                         </div>
                       </template>
-                    </el-table-column>
-                    <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
+                    </el-table-column> -->
+                    <el-table-column prop="remark" label="备注" min-width="180" />
+                    <!-- <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() &&  isEditList">
                       <template #default="{ row,$index }">
                         <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
                       </template>
-                    </el-table-column>
+                    </el-table-column> -->
                   </el-table>
                 </div>
               </template>
@@ -399,7 +403,7 @@
                   <el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
                                 class="margin-b-0 wid100">
                     <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
-                                     :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
+                                     :controls="false" :min="0" @change="calculationAmount(true)" v-if="isEditList" />
                     <div v-else> {{row.quantity}}</div>
                   </el-form-item>
                 </div>
@@ -488,9 +492,9 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
+            <el-table-column label="操作" width="80" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
               <template #default="{ $index }">
-                <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材/配件/辅材</el-button>
+                <!-- <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材/配件/辅材</el-button> -->
                 <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
             </el-table-column>
@@ -1661,21 +1665,27 @@ const selectProduct = async (goods) => {
     }
     proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
       if (res.productBomDetailList && res.productBomDetailList.length > 0) {
-        contractProductBomList.value = res.productBomDetailList.map((x) => ({
-          fileUrl: "",
-          materialId: x.materialId,
-          productName: x.materialName,
-          productCode: x.materialCode,
-          productLength: x.materialLength,
-          productWidth: x.materialWidth,
-          productHeight: x.materialHeight,
-          quantity: x.quantity || null,
-          allQuantity: "",
-          price: x.materialPrice || null,
-          amount: "",
-          fileList: [],
-          type: x.type,
-        }));
+        contractProductBomList.value = res.productBomDetailList
+          .filter((x) => x.type != 3)
+          .map((x) => ({
+            fileUrl: "",
+            materialId: x.materialId,
+            productName: x.materialName,
+            productCode: x.materialCode,
+            productLength: x.materialLength,
+            productWidth: x.materialWidth,
+            productHeight: x.materialHeight,
+            productColor: x.materialColor,
+            standardDosage: x.standardDosage,
+            lossRate: x.lossRate,
+            remark: x.remark || "",
+            quantity: null,
+            allQuantity: "",
+            price: x.materialPrice || null,
+            amount: "",
+            fileList: [],
+            type: x.type,
+          }));
         let fileListOne = [];
         if (allFile && allFile.length > 0) {
           fileListOne = allFile.filter((x) => x.businessType == "2");
@@ -1820,7 +1830,7 @@ const handleDeleteMaterial = (index, sonIndex) => {
   );
 };
 
-const calculationAmount = () => {
+const calculationAmount = (flag = flase) => {
   if (
     formData.data.contractProductList &&
     formData.data.contractProductList.length > 0
@@ -1834,6 +1844,15 @@ const calculationAmount = () => {
         Number(formData.data.contractProductList[i].quantity) *
           Number(formData.data.contractProductList[i].factoryPrice)
       ).toFixed(2);
+      let row = formData.data.contractProductList[i];
+      if (flag) {
+        for (let j = 0; j < row.contractProductBomList.length; j++) {
+          let jrow = row.contractProductBomList[j];
+          jrow.quantity = Math.ceil(
+            (row.quantity / jrow.standardDosage) * (1 + jrow.lossRate / 100)
+          );
+        }
+      }
     }
   }
   totalAmount();
@@ -2030,6 +2049,7 @@ const handleSubmit = async (isStag = false) => {
     //   const errorDiv = document.getElementsByClassName("is-error");
     //   errorDiv[0].scrollIntoView();
     // }, 0);
+    isShowOther.value = true;
   }
   return flag;
 };
@@ -2252,7 +2272,7 @@ const getAllData = (businessId) => {
         });
       changeProductPrice();
     }
-    calculationAmount();
+    calculationAmount(true);
     if (formData.data.countryId) {
       getCityData(formData.data.countryId, "20");
     }

+ 219 - 70
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -69,15 +69,73 @@
           </template>
 
           <template #rawMaterialIdSlot>
-            <div style="width:100%;padding-left:15px">
-              <!-- <div style="width:calc(100% - 65px)">
-                <el-form-item label="原材料" prop="rawMaterialId" class="margin-b-0">
-                  <el-input disabled v-model="formData.data.rawMaterialIdLabel" placeholder="请选择"></el-input>
-                </el-form-item>
+            <div style="width:100%;padding-left:25px">
+              <div>
+                <el-button type="primary" @click="openDialog(1)" plain>主材</el-button>
+                <el-button type="primary" @click="openDialog(2)" plain>工艺</el-button>
+                <el-button type="primary" @click="openDialog(3)" plain>辅材</el-button>
               </div>
-              <el-button type="primary" style="width:50px;margin-left:15px" @click="openSelectRawMaterial = true" plain>选择</el-button> -->
-              <el-button type="primary" @click="openSelectRawMaterial = true" plain>选择</el-button>
-              <el-table :data="formData.data.rawMaterialList" style="width: 100%; margin-top: 16px">
+              <el-table :data="formData.data.productBomDetailList" style="width: 100%; margin-top: 16px">
+                <el-table-column prop="materialName" label="物料名称" width="170" />
+                <el-table-column prop="materialCode" label="物料编码" width="190" />
+                <el-table-column label="规格尺寸 (cm)" width="140">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%" v-if="row.materialLength&&row.materialWidth && row.materialHeight">
+                      {{row.materialLength}}*{{row.materialWidth}}*{{row.materialHeight}}
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="materialColor" label="颜色" width="170" />
+                <el-table-column label="数量" width="150">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                         :controls="false" :min="1" />
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="标准用量" width="150">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.standardDosage'" :rules="rules.standardDosage" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input-number onmousewheel="return false;" v-model="row.standardDosage" placeholder="请输入" style="width: 100%"
+                                         :precision="0" :controls="false" :min="1" />
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="损耗率(%)" width="150">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.lossRate'" :rules="rules.lossRate" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input-number onmousewheel="return false;" v-model="row.lossRate" placeholder="请输入" style="width: 100%" :precision="2"
+                                         :controls="false" :min="0" :max="100" />
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="备注" min-width="200">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input v-model="row.remark" placeholder="请输入"> </el-input>
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="操作" width="60" align="center" fixed="right">
+                  <template #default="{ row, $index }">
+                    <el-button type="primary" link @click="handleRemove($index,1)" v-if="row.type !=3">删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <!-- <el-table :data="formData.data.rawMaterialList" style="width: 100%; margin-top: 16px">
                 <el-table-column prop="rawMaterialName" label="原材料名称" />
                 <el-table-column prop="rawMaterialCode" label="原材料编码" />
                 <el-table-column label="规格尺寸 (cm)">
@@ -88,7 +146,7 @@
                   </template>
                 </el-table-column>
                 <el-table-column prop="rawMaterialColor" label="颜色" />
-              </el-table>
+              </el-table> -->
             </div>
           </template>
 
@@ -173,7 +231,7 @@
 
           <template #technology>
             <div style="width:100%">
-              <div class="small-title">
+              <!-- <div class="small-title">
                 ① 工艺线路
               </div>
               <el-row style="width:100%">
@@ -184,9 +242,9 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
-              </el-row>
+              </el-row> -->
               <div class="small-title">
-                 LOGO
+                 LOGO
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -221,7 +279,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 折叠
+                 折叠
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -242,7 +300,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 包装要求
+                 包装要求
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -254,7 +312,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 是否定制
+                 是否定制
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -440,6 +498,13 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'工艺选择'" v-model="openSelectTechnology" width="90%" destroy-on-close>
+      <SelectTechnology :isSelect="true" @selectTechnology="selectTechnology"></SelectTechnology>
+      <template #footer>
+        <el-button @click="openSelectTechnology = false" size="defualt" v-debounce>取 消</el-button>
+      </template>
+    </el-dialog>
+
     <el-dialog title="导入产品" v-model="openExcelDialog" width="400">
       <div v-loading="excelLoading">
         <el-upload :action="actionUrl + '/productInfo/excelImportByEhsd'" :headers="headers" :on-success="handleSuccess" :on-progress="handleProgress"
@@ -461,6 +526,8 @@ import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
 import SelectMaterial from "@/components/product/SelectMaterial.vue";
 import { getToken } from "@/utils/auth";
+import SelectTechnology from "@/views/production/project/technology/index.vue";
+
 const { proxy } = getCurrentInstance();
 const actionUrl = import.meta.env.VITE_APP_BASE_API;
 const loading = ref(false);
@@ -527,6 +594,10 @@ const rules = ref({
   ],
   foldWay: [{ required: true, message: "请选择折叠数", trigger: "change" }],
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  standardDosage: [
+    { required: true, message: "请输入标准用量", trigger: "blur" },
+  ],
+  lossRate: [{ required: true, message: "请输入损耗率", trigger: "blur" }],
   // remark: [{ required: true, message: "请输入描述", trigger: "blur" }],
   // reverseTexture: [
   //   { required: true, message: "请选择背面纹路", trigger: "change" },
@@ -876,6 +947,31 @@ const formConfig = computed(() => {
       disabled: false,
     },
     {
+      type: "slot",
+      slotName: "color",
+      prop: "",
+      label: "",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "slot",
+      slotName: "size",
+      prop: "",
+      label: "",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "number",
+      prop: "netWeight",
+      label: "净重(kg)",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
       type: "input",
       itemType: "textarea",
       prop: "remark",
@@ -915,7 +1011,7 @@ const formConfig = computed(() => {
     // },
     {
       type: "title1",
-      title: "主材",
+      title: "BOM",
     },
     // {
     //   type: "select",
@@ -948,14 +1044,14 @@ const formConfig = computed(() => {
     //   type: "input",
     //   prop: "rawMaterialSize",
     //   label: "原材料尺寸",
-    //   itemWidth: 33.33,
+    //   itemWidth: 50,
     //   disabled: true,
     // },
     // {
     //   type: "input",
     //   prop: "rawMaterialColor",
     //   label: "原材料颜色",
-    //   itemWidth: 33.33,
+    //   itemWidth: 50,
     //   disabled: true,
     // },
 
@@ -988,22 +1084,7 @@ const formConfig = computed(() => {
     //   itemWidth: 50,
     //   disabled: false,
     // },
-    {
-      type: "slot",
-      slotName: "color",
-      prop: "",
-      label: "",
-      itemWidth: 33.33,
-      disabled: false,
-    },
-    {
-      type: "slot",
-      slotName: "size",
-      prop: "",
-      label: "",
-      itemWidth: 33.33,
-      disabled: false,
-    },
+
     // {
     //   type: "select",
     //   prop: "innerPackMethod",
@@ -1034,15 +1115,7 @@ const formConfig = computed(() => {
     //   },
     //   disabled: false,
     // },
-    {
-      type: "number",
-      prop: "netWeight",
-      label: "净重(kg)",
-      precision: 2,
-      min: 0,
-      controls: false,
-      itemWidth: 33.33,
-    },
+
     // {
     //   type: "input",
     //   itemType: "textarea",
@@ -1050,14 +1123,14 @@ const formConfig = computed(() => {
     //   label: "备注",
     //   itemWidth: 100,
     // },
-    {
-      type: "title1",
-      title: "辅材",
-    },
-    {
-      type: "slot",
-      slotName: "materialDetail",
-    },
+    // {
+    //   type: "title1",
+    //   title: "辅材",
+    // },
+    // {
+    //   type: "slot",
+    //   slotName: "materialDetail",
+    // },
     {
       type: "title1",
       title: "附加工艺要求",
@@ -1272,9 +1345,6 @@ const getDtl = (row) => {
         rawMaterialColor: res.rawMaterialColor,
       },
     ];
-    formData.data.productBomDetailList =
-      formData.data.productBomDetailList.filter((x) => x.type == 2);
-
     if (
       formData.data.productCustomInfoList &&
       formData.data.productCustomInfoList.length > 0
@@ -1474,6 +1544,7 @@ const selectMaterial = (row) => {
     );
     if (!flag) {
       formData.data.productBomDetailList.push({
+        materialId: row.id,
         type: 2,
         materialName: row.name,
         materialCode: row.customCode,
@@ -1481,8 +1552,10 @@ const selectMaterial = (row) => {
         materialWidth: row.width,
         materialHeight: row.height,
         materialColor: row.color,
-        materialId: row.id,
         quantity: null,
+        standardDosage: null,
+        lossRate: null,
+        remark: "",
       });
       proxy.msgTip("选择成功");
     } else {
@@ -1659,22 +1732,98 @@ const handleChangeIsCustomized = (val) => {
 
 const openSelectRawMaterial = ref(false);
 const selectRawMaterial = (row) => {
-  formData.data.rawMaterialId = row.id;
-  formData.data.rawMaterialIdLabel = row.name + "," + row.customCode;
-  formData.data.rawMaterialSize = `${row["length"]}*${row.width}*${row.height}`;
-  formData.data.rawMaterialColor = row.color;
+  // formData.data.rawMaterialId = row.id;
+  // formData.data.rawMaterialIdLabel = row.name + "," + row.customCode;
+  // formData.data.rawMaterialSize = `${row["length"]}*${row.width}*${row.height}`;
+  // formData.data.rawMaterialColor = row.color;
 
-  formData.data.rawMaterialList = [
-    {
-      rawMaterialName: row.name,
-      rawMaterialCode: row.customCode,
-      rawMaterialLength: row["length"],
-      rawMaterialWidth: row.width,
-      rawMaterialHeight: row.height,
-      rawMaterialColor: row.color,
-    },
-  ];
-  openSelectRawMaterial.value = false;
+  // formData.data.rawMaterialList = [
+  //   {
+  //     rawMaterialName: row.name,
+  //     rawMaterialCode: row.customCode,
+  //     rawMaterialLength: row["length"],
+  //     rawMaterialWidth: row.width,
+  //     rawMaterialHeight: row.height,
+  //     rawMaterialColor: row.color,
+  //   },
+  // ];
+  // openSelectRawMaterial.value = false;
+  if (dialogOpenType.value == 1) {
+    let flag = formData.data.productBomDetailList.some(
+      (x) => x.materialId == row.id
+    );
+    if (!flag) {
+      formData.data.productBomDetailList.unshift({
+        materialId: row.id,
+        type: 1,
+        materialName: row.name,
+        materialCode: row.customCode,
+        materialLength: row["length"],
+        materialWidth: row.width,
+        materialHeight: row.height,
+        materialColor: row.color,
+        quantity: null,
+        standardDosage: null,
+        lossRate: null,
+        remark: "",
+      });
+      proxy.msgTip("选择成功");
+    } else {
+      proxy.msgTip("该物料已选择", 2);
+    }
+  }
+};
+
+const openSelectTechnology = ref(false);
+const dialogOpenType = ref(-1);
+const openDialog = (type) => {
+  dialogOpenType.value = type;
+  if (type == 1) {
+    openSelectRawMaterial.value = true;
+  }
+  if (type == 2) {
+    openSelectTechnology.value = true;
+  }
+  if (type == 3) {
+    clickOpenSelectMaterial(1);
+  }
+};
+
+const selectTechnology = (row) => {
+  if (
+    dialogOpenType.value == 2 &&
+    row.processRouteList &&
+    row.processRouteList.length > 0
+  ) {
+    formData.data.productBomDetailList =
+      formData.data.productBomDetailList.filter((x) => x.type != 3);
+    let index = formData.data.productBomDetailList.findIndex(
+      (x) => x.type == 2
+    );
+    let arr = row.processRouteList.map((x) => ({
+      type: 3,
+      materialId: x.id,
+      materialName: x.name,
+      quantity: null,
+      standardDosage: null,
+      lossRate: null,
+      remark: "",
+    }));
+
+    if (index >= 0) {
+      formData.data.productBomDetailList.splice(index, 0, ...arr);
+    } else {
+      formData.data.productBomDetailList.splice(
+        formData.data.productBomDetailList.length
+          ? formData.data.productBomDetailList.length
+          : 0,
+        0,
+        ...arr
+      );
+    }
+    openSelectTechnology.value = false;
+    return proxy.msgTip("选择成功", 1);
+  }
 };
 </script>
 

+ 218 - 68
src/views/EHSD/productLibrary/waitCreateProduct/index.vue

@@ -46,17 +46,74 @@
               <el-button type="primary" plain @click="handleClickUpload('prodImgPath',false)" v-else>点击查看</el-button>
             </div>
           </template>
-
           <template #rawMaterialIdSlot>
-            <div style="width:100%;padding-left:15px">
-              <!-- <div style="width:calc(100% - 65px)">
-                <el-form-item label="原材料" prop="rawMaterialId" class="margin-b-0">
-                  <el-input disabled v-model="formData.data.rawMaterialIdLabel" placeholder="请选择"></el-input>
-                </el-form-item>
+            <div style="width:100%;padding-left:25px">
+              <div>
+                <el-button type="primary" @click="openDialog(1)" plain>主材</el-button>
+                <el-button type="primary" @click="openDialog(2)" plain>工艺</el-button>
+                <el-button type="primary" @click="openDialog(3)" plain>辅材</el-button>
               </div>
-              <el-button type="primary" style="width:50px;margin-left:15px" @click="openSelectRawMaterial = true" plain>选择</el-button> -->
-              <el-button type="primary" @click="openSelectRawMaterial = true" plain>选择</el-button>
-              <el-table :data="formData.data.rawMaterialList" style="width: 100%; margin-top: 16px">
+              <el-table :data="formData.data.productBomDetailList" style="width: 100%; margin-top: 16px">
+                <el-table-column prop="materialName" label="物料名称" width="170" />
+                <el-table-column prop="materialCode" label="物料编码" width="190" />
+                <el-table-column label="规格尺寸 (cm)" width="140">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%" v-if="row.materialLength&&row.materialWidth && row.materialHeight">
+                      {{row.materialLength}}*{{row.materialWidth}}*{{row.materialHeight}}
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="materialColor" label="颜色" width="170" />
+                <el-table-column label="数量" width="150">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
+                                         :controls="false" :min="1" />
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="标准用量" width="150">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.standardDosage'" :rules="rules.standardDosage" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input-number onmousewheel="return false;" v-model="row.standardDosage" placeholder="请输入" style="width: 100%"
+                                         :precision="0" :controls="false" :min="1" />
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="损耗率(%)" width="150">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.lossRate'" :rules="rules.lossRate" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input-number onmousewheel="return false;" v-model="row.lossRate" placeholder="请输入" style="width: 100%" :precision="2"
+                                         :controls="false" :min="0" :max="100" />
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="备注" min-width="200">
+                  <template #default="{ row, $index }">
+                    <div style="width: 100%">
+                      <el-form-item :prop="'productBomDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true"
+                                    class="margin-b-0 wid100">
+                        <el-input v-model="row.remark" placeholder="请输入"> </el-input>
+                      </el-form-item>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="操作" width="60" align="center" fixed="right">
+                  <template #default="{ row, $index }">
+                    <el-button type="primary" link @click="handleRemove($index,1)" v-if="row.type !=3">删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <!-- <el-table :data="formData.data.rawMaterialList" style="width: 100%; margin-top: 16px">
                 <el-table-column prop="rawMaterialName" label="原材料名称" />
                 <el-table-column prop="rawMaterialCode" label="原材料编码" />
                 <el-table-column label="规格尺寸 (cm)">
@@ -67,7 +124,7 @@
                   </template>
                 </el-table-column>
                 <el-table-column prop="rawMaterialColor" label="颜色" />
-              </el-table>
+              </el-table> -->
             </div>
           </template>
 
@@ -152,7 +209,7 @@
 
           <template #technology>
             <div style="width:100%">
-              <div class="small-title">
+              <!-- <div class="small-title">
                 ① 工艺线路
               </div>
               <el-row style="width:100%">
@@ -163,9 +220,9 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
-              </el-row>
+              </el-row> -->
               <div class="small-title">
-                 LOGO
+                 LOGO
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -183,6 +240,12 @@
                                            :min="0" onmousewheel="return false;" />
                         </el-form-item>
                       </el-col>
+                      <!-- <el-col :span="8">
+                        <el-form-item prop="logoHeight" label-width="0px" class="margin-b-0 wid100">
+                          <el-input-number v-model="formData.data.logoHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
+                                           :controls="false" :min="0" onmousewheel="return false;" />
+                        </el-form-item>
+                      </el-col> -->
                     </el-row>
                   </el-form-item>
                 </el-col>
@@ -194,7 +257,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 折叠
+                 折叠
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -215,7 +278,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 包装要求
+                 包装要求
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -227,12 +290,12 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 是否定制
+                 是否定制
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
                   <el-form-item prop="isCustomized" label="是否定制" class="wid100">
-                    <el-select v-model="formData.data.isCustomized" placeholder="请选择" style="width:100%">
+                    <el-select v-model="formData.data.isCustomized" placeholder="请选择" style="width:100%" @change="handleChangeIsCustomized">
                       <el-option :label="'否'" :value="0" />
                       <el-option :label="'是'" :value="1" />
                     </el-select>
@@ -295,6 +358,13 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'工艺选择'" v-model="openSelectTechnology" width="90%" destroy-on-close>
+      <SelectTechnology :isSelect="true" @selectTechnology="selectTechnology"></SelectTechnology>
+      <template #footer>
+        <el-button @click="openSelectTechnology = false" size="defualt" v-debounce>取 消</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -304,6 +374,8 @@ import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
 import SelectMaterial from "@/components/product/SelectMaterial.vue";
 import { getToken } from "@/utils/auth";
+import SelectTechnology from "@/views/production/project/technology/index.vue";
+
 const { proxy } = getCurrentInstance();
 const actionUrl = import.meta.env.VITE_APP_BASE_API;
 const loading = ref(false);
@@ -709,6 +781,31 @@ const formConfig = computed(() => {
       disabled: false,
     },
     {
+      type: "slot",
+      slotName: "color",
+      prop: "",
+      label: "",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "slot",
+      slotName: "size",
+      prop: "",
+      label: "",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "number",
+      prop: "netWeight",
+      label: "净重(kg)",
+      precision: 2,
+      min: 0,
+      controls: false,
+      itemWidth: 50,
+    },
+    {
       type: "input",
       itemType: "textarea",
       prop: "remark",
@@ -748,7 +845,7 @@ const formConfig = computed(() => {
     // },
     {
       type: "title1",
-      title: "主材",
+      title: "BOM",
     },
     // {
     //   type: "select",
@@ -781,14 +878,14 @@ const formConfig = computed(() => {
     //   type: "input",
     //   prop: "rawMaterialSize",
     //   label: "原材料尺寸",
-    //   itemWidth: 33.33,
+    //   itemWidth: 50,
     //   disabled: true,
     // },
     // {
     //   type: "input",
     //   prop: "rawMaterialColor",
     //   label: "原材料颜色",
-    //   itemWidth: 33.33,
+    //   itemWidth: 50,
     //   disabled: true,
     // },
 
@@ -821,22 +918,7 @@ const formConfig = computed(() => {
     //   itemWidth: 50,
     //   disabled: false,
     // },
-    {
-      type: "slot",
-      slotName: "color",
-      prop: "",
-      label: "",
-      itemWidth: 33.33,
-      disabled: false,
-    },
-    {
-      type: "slot",
-      slotName: "size",
-      prop: "",
-      label: "",
-      itemWidth: 33.33,
-      disabled: false,
-    },
+
     // {
     //   type: "select",
     //   prop: "innerPackMethod",
@@ -867,15 +949,7 @@ const formConfig = computed(() => {
     //   },
     //   disabled: false,
     // },
-    {
-      type: "number",
-      prop: "netWeight",
-      label: "净重(kg)",
-      precision: 2,
-      min: 0,
-      controls: false,
-      itemWidth: 33.33,
-    },
+
     // {
     //   type: "input",
     //   itemType: "textarea",
@@ -883,14 +957,14 @@ const formConfig = computed(() => {
     //   label: "备注",
     //   itemWidth: 100,
     // },
-    {
-      type: "title1",
-      title: "辅材",
-    },
-    {
-      type: "slot",
-      slotName: "materialDetail",
-    },
+    // {
+    //   type: "title1",
+    //   title: "辅材",
+    // },
+    // {
+    //   type: "slot",
+    //   slotName: "materialDetail",
+    // },
     {
       type: "title1",
       title: "附加工艺要求",
@@ -1290,22 +1364,98 @@ const handleClickUpload = async (att, flag) => {
 
 const openSelectRawMaterial = ref(false);
 const selectRawMaterial = (row) => {
-  formData.data.rawMaterialId = row.id;
-  formData.data.rawMaterialIdLabel = row.name + "," + row.customCode;
-  formData.data.rawMaterialSize = `${row["length"]}*${row.width}*${row.height}`;
-  formData.data.rawMaterialColor = row.color;
+  // formData.data.rawMaterialId = row.id;
+  // formData.data.rawMaterialIdLabel = row.name + "," + row.customCode;
+  // formData.data.rawMaterialSize = `${row["length"]}*${row.width}*${row.height}`;
+  // formData.data.rawMaterialColor = row.color;
 
-  formData.data.rawMaterialList = [
-    {
-      rawMaterialName: row.name,
-      rawMaterialCode: row.customCode,
-      rawMaterialLength: row["length"],
-      rawMaterialWidth: row.width,
-      rawMaterialHeight: row.height,
-      rawMaterialColor: row.color,
-    },
-  ];
-  openSelectRawMaterial.value = false;
+  // formData.data.rawMaterialList = [
+  //   {
+  //     rawMaterialName: row.name,
+  //     rawMaterialCode: row.customCode,
+  //     rawMaterialLength: row["length"],
+  //     rawMaterialWidth: row.width,
+  //     rawMaterialHeight: row.height,
+  //     rawMaterialColor: row.color,
+  //   },
+  // ];
+  // openSelectRawMaterial.value = false;
+  if (dialogOpenType.value == 1) {
+    let flag = formData.data.productBomDetailList.some(
+      (x) => x.materialId == row.id
+    );
+    if (!flag) {
+      formData.data.productBomDetailList.unshift({
+        materialId: row.id,
+        type: 1,
+        materialName: row.name,
+        materialCode: row.customCode,
+        materialLength: row["length"],
+        materialWidth: row.width,
+        materialHeight: row.height,
+        materialColor: row.color,
+        quantity: null,
+        standardDosage: null,
+        lossRate: null,
+        remark: "",
+      });
+      proxy.msgTip("选择成功");
+    } else {
+      proxy.msgTip("该物料已选择", 2);
+    }
+  }
+};
+
+const openSelectTechnology = ref(false);
+const dialogOpenType = ref(-1);
+const openDialog = (type) => {
+  dialogOpenType.value = type;
+  if (type == 1) {
+    openSelectRawMaterial.value = true;
+  }
+  if (type == 2) {
+    openSelectTechnology.value = true;
+  }
+  if (type == 3) {
+    clickOpenSelectMaterial(1);
+  }
+};
+
+const selectTechnology = (row) => {
+  if (
+    dialogOpenType.value == 2 &&
+    row.processRouteList &&
+    row.processRouteList.length > 0
+  ) {
+    formData.data.productBomDetailList =
+      formData.data.productBomDetailList.filter((x) => x.type != 3);
+    let index = formData.data.productBomDetailList.findIndex(
+      (x) => x.type == 2
+    );
+    let arr = row.processRouteList.map((x) => ({
+      type: 3,
+      materialId: x.id,
+      materialName: x.name,
+      quantity: null,
+      standardDosage: null,
+      lossRate: null,
+      remark: "",
+    }));
+
+    if (index >= 0) {
+      formData.data.productBomDetailList.splice(index, 0, ...arr);
+    } else {
+      formData.data.productBomDetailList.splice(
+        formData.data.productBomDetailList.length
+          ? formData.data.productBomDetailList.length
+          : 0,
+        0,
+        ...arr
+      );
+    }
+    openSelectTechnology.value = false;
+    return proxy.msgTip("选择成功", 1);
+  }
 };
 </script>
 

+ 38 - 21
src/views/EHSD/saleContract/PriceSheetDetail.vue

@@ -186,18 +186,18 @@
                 </template>
                 <div style="width:100%">
                   <div style="margin:10px 0">
-                    <TitleInfo :content="'主材'"></TitleInfo>
+                    <TitleInfo :content="'基本信息'"></TitleInfo>
                   </div>
                   <div style="width: 100%;padding-left:15px">
                     <el-row>
-                      <el-col :span="12">
+                      <!-- <el-col :span="12">
                         <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId" :inline-message="true"
                                       label="原材料" class="wid100">
                           <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
                             <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
                           </el-select>
                         </el-form-item>
-                      </el-col>
+                      </el-col> -->
                       <el-col :span="12">
                         <el-form-item label="颜色" class="margin-b-0 wid100">
                           <el-row style="width: 100%">
@@ -214,10 +214,8 @@
                           </el-row>
                         </el-form-item>
                       </el-col>
-                    </el-row>
-                    <el-row>
                       <el-col :span="12">
-                        <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                        <el-form-item label="尺寸" required>
                           <el-row style="width:100%">
                             <el-col :span="8">
                               <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
@@ -243,6 +241,9 @@
                           </el-row>
                         </el-form-item>
                       </el-col>
+                    </el-row>
+                    <el-row>
+
                       <el-col :span="12">
                         <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
                           <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false" :min="0"
@@ -257,7 +258,7 @@
                     <TitleInfo :content="'辅材'"></TitleInfo>
                   </div>
                   <div style="width: 100%;padding-left:15px">
-                    <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
+                    <!-- <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
                       <el-table-column prop="productName" label="物料名称" />
                       <el-table-column prop="productCode" label="物料编码" />
                       <el-table-column label="数量" width="150">
@@ -271,6 +272,22 @@
                           </div>
                         </template>
                       </el-table-column>
+                    </el-table> -->
+                    <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
+                      <el-table-column prop="productName" label="物料名称" width="170" />
+                      <el-table-column prop="productCode" label="物料编码" width="180" />
+                      <el-table-column label="规格尺寸(cm)" width="130">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
+                            {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
+                          </div>
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="productColor" label="颜色" width="170" />
+                      <el-table-column prop="quantity" label="数量" width="100" />
+                      <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                      <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                      <el-table-column prop="remark" label="备注" min-width="150" />
                     </el-table>
                   </div>
 
@@ -279,7 +296,7 @@
                   </div>
 
                   <div style="width:100%;padding-left:15px">
-                    <div class="small-title">
+                    <!-- <div class="small-title">
                       ① 工艺线路
                     </div>
                     <el-row style="width:100%">
@@ -291,9 +308,9 @@
                           </el-select>
                         </el-form-item>
                       </el-col>
-                    </el-row>
+                    </el-row> -->
                     <div class="small-title">
-                       LOGO
+                       LOGO
                     </div>
                     <el-row style="width:100%">
                       <el-col :span="12">
@@ -331,7 +348,7 @@
                       </el-col>
                     </el-row>
                     <div class="small-title">
-                       折叠
+                       折叠
                     </div>
                     <el-row style="width:100%">
                       <el-col :span="12">
@@ -352,7 +369,7 @@
                       </el-col>
                     </el-row>
                     <div class="small-title">
-                       包装要求
+                       包装要求
                     </div>
                     <el-row style="width:100%">
                       <el-col :span="12">
@@ -364,7 +381,7 @@
                       </el-col>
                     </el-row>
                     <div class="small-title">
-                       是否定制
+                       是否定制
                     </div>
                     <el-row style="width:100%">
                       <el-col :span="12">
@@ -801,14 +818,14 @@ const getData = (query) => {
         } else {
           iele.packAsk = [];
         }
-        if (
-          iele.quotationProductBomList &&
-          iele.quotationProductBomList.length > 0
-        ) {
-          iele.quotationProductBomList = iele.quotationProductBomList.filter(
-            (x) => x.type == 2
-          );
-        }
+        // if (
+        //   iele.quotationProductBomList &&
+        //   iele.quotationProductBomList.length > 0
+        // ) {
+        //   iele.quotationProductBomList = iele.quotationProductBomList.filter(
+        //     (x) => x.type == 2
+        //   );
+        // }
         if (
           iele.quotationProductCustomInfoList &&
           iele.quotationProductCustomInfoList.length > 0

+ 337 - 125
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -217,18 +217,18 @@
                   </template>
                   <div style="width:100%">
                     <div style="margin:10px 0">
-                      <TitleInfo :content="'主材'"></TitleInfo>
+                      <TitleInfo :content="'基本信息'"></TitleInfo>
                     </div>
                     <div style="width: 100%;padding-left:15px">
                       <el-row>
-                        <el-col :span="12">
+                        <!-- <el-col :span="12">
                           <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId" :inline-message="true"
                                         label="原材料" class="wid100">
                             <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%" filterable>
                               <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
                             </el-select>
                           </el-form-item>
-                        </el-col>
+                        </el-col> -->
                         <el-col :span="12">
                           <el-form-item label="颜色" class="margin-b-0 wid100">
                             <el-row style="width: 100%">
@@ -245,10 +245,8 @@
                             </el-row>
                           </el-form-item>
                         </el-col>
-                      </el-row>
-                      <el-row>
                         <el-col :span="12">
-                          <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                          <el-form-item label="尺寸" required>
                             <el-row style="width:100%">
                               <el-col :span="8">
                                 <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
@@ -274,6 +272,8 @@
                             </el-row>
                           </el-form-item>
                         </el-col>
+                      </el-row>
+                      <el-row>
                         <el-col :span="12">
                           <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
                             <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
@@ -285,10 +285,10 @@
                     </div>
 
                     <div style="margin:10px 0">
-                      <TitleInfo :content="'辅材'"></TitleInfo>
+                      <TitleInfo :content="'BOM'"></TitleInfo>
                     </div>
                     <div style="width: 100%;padding-left:15px">
-                      <el-button type="primary" @click="handleClickSelectMaterial(index)" plain>选择包材/配件/辅材</el-button>
+                      <!-- <el-button type="primary" @click="handleClickSelectMaterial(index)" plain>选择包材/配件/辅材</el-button>
                       <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
                         <el-table-column prop="materialName" label="物料名称" />
                         <el-table-column prop="materialCode" label="物料编码" />
@@ -308,6 +308,70 @@
                             <el-button type="primary" link @click="handleRemoveBom(index,$index)">删除</el-button>
                           </template>
                         </el-table-column>
+                      </el-table> -->
+                      <div>
+                        <el-button type="primary" @click="openDialog(index,1)" plain>主材</el-button>
+                        <el-button type="primary" @click="openDialog(index,2)" plain>工艺</el-button>
+                        <el-button type="primary" @click="openDialog(index,3)" plain>辅材</el-button>
+                      </div>
+                      <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
+                        <el-table-column prop="materialName" label="物料名称" width="170" />
+                        <el-table-column prop="materialCode" label="物料编码" width="190" />
+                        <el-table-column label="规格尺寸 (cm)" width="140">
+                          <template #default="{ row, $index }">
+                            <div style="width: 100%" v-if="row.materialLength&&row.materialWidth && row.materialHeight">
+                              {{row.materialLength}}*{{row.materialWidth}}*{{row.materialHeight}}
+                            </div>
+                          </template>
+                        </el-table-column>
+                        <el-table-column prop="materialColor" label="颜色" width="170" />
+                        <el-table-column label="数量" width="150">
+                          <template #default="{ row, $index }">
+                            <div style="width: 100%">
+                              <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.quantity'"
+                                            :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
+                                <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%"
+                                                 :precision="0" :controls="false" :min="1" />
+                              </el-form-item>
+                            </div>
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="标准用量" width="150">
+                          <template #default="{ row, $index }">
+                            <div style="width: 100%">
+                              <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.standardDosage'"
+                                            :rules="rules.standardDosage" :inline-message="true" class="margin-b-0 wid100">
+                                <el-input-number onmousewheel="return false;" v-model="row.standardDosage" placeholder="请输入" style="width: 100%"
+                                                 :precision="0" :controls="false" :min="1" />
+                              </el-form-item>
+                            </div>
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="损耗率(%)" width="150">
+                          <template #default="{ row, $index }">
+                            <div style="width: 100%">
+                              <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.lossRate'"
+                                            :rules="rules.lossRate" :inline-message="true" class="margin-b-0 wid100">
+                                <el-input-number onmousewheel="return false;" v-model="row.lossRate" placeholder="请输入" style="width: 100%"
+                                                 :precision="2" :controls="false" :min="0" :max="100" />
+                              </el-form-item>
+                            </div>
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="备注" min-width="200">
+                          <template #default="{ row, $index }">
+                            <div style="width: 100%">
+                              <el-form-item class="margin-b-0 wid100">
+                                <el-input v-model="row.remark" placeholder="请输入"> </el-input>
+                              </el-form-item>
+                            </div>
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="操作" width="60" align="center" fixed="right">
+                          <template #default="{ row, $index }">
+                            <el-button type="primary" link @click="handleRemoveBom(index,$index)" v-if="row.type !=3">删除</el-button>
+                          </template>
+                        </el-table-column>
                       </el-table>
                     </div>
 
@@ -316,7 +380,7 @@
                     </div>
 
                     <div style="width:100%;padding-left:15px">
-                      <div class="small-title">
+                      <!-- <div class="small-title">
                         ① 工艺线路
                       </div>
                       <el-row style="width:100%">
@@ -328,9 +392,9 @@
                             </el-select>
                           </el-form-item>
                         </el-col>
-                      </el-row>
+                      </el-row> -->
                       <div class="small-title">
-                         LOGO
+                         LOGO
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -368,7 +432,7 @@
                         </el-col>
                       </el-row>
                       <div class="small-title">
-                         折叠
+                         折叠
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -389,7 +453,7 @@
                         </el-col>
                       </el-row>
                       <div class="small-title">
-                         包装要求
+                         包装要求
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -401,7 +465,7 @@
                         </el-col>
                       </el-row>
                       <div class="small-title">
-                         是否定制
+                         是否定制
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -587,18 +651,18 @@
                   <el-form disabled label-width="100px">
                     <div style="width:100%">
                       <div style="margin:10px 0">
-                        <TitleInfo :content="'主材'"></TitleInfo>
+                        <TitleInfo :content="'基本信息'"></TitleInfo>
                       </div>
                       <div style="width: 100%;padding-left:15px">
                         <el-row>
-                          <el-col :span="12">
+                          <!-- <el-col :span="12">
                             <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId"
                                           :inline-message="true" label="原材料" class="wid100">
                               <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
                                 <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
                               </el-select>
                             </el-form-item>
-                          </el-col>
+                          </el-col> -->
                           <el-col :span="12">
                             <el-form-item label="颜色" class="margin-b-0 wid100">
                               <el-row style="width: 100%">
@@ -615,10 +679,8 @@
                               </el-row>
                             </el-form-item>
                           </el-col>
-                        </el-row>
-                        <el-row>
                           <el-col :span="12">
-                            <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                            <el-form-item label="尺寸" required>
                               <el-row style="width:100%">
                                 <el-col :span="8">
                                   <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
@@ -644,6 +706,9 @@
                               </el-row>
                             </el-form-item>
                           </el-col>
+                        </el-row>
+                        <el-row>
+
                           <el-col :span="12">
                             <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
                               <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
@@ -655,23 +720,24 @@
                       </div>
 
                       <div style="margin:10px 0">
-                        <TitleInfo :content="'辅材'"></TitleInfo>
+                        <TitleInfo :content="'BOM'"></TitleInfo>
                       </div>
                       <div style="width: 100%;padding-left:15px">
                         <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
-                          <el-table-column prop="productName" label="物料名称" />
-                          <el-table-column prop="productCode" label="物料编码" />
-                          <el-table-column label="数量" width="150">
+                          <el-table-column prop="productName" label="物料名称" width="170" />
+                          <el-table-column prop="productCode" label="物料编码" width="180" />
+                          <el-table-column label="规格尺寸(cm)" width="130">
                             <template #default="{ row, $index }">
-                              <div style="width: 100%">
-                                <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.quantity'"
-                                              :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
-                                  <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder=" " style="width: 100%"
-                                                   :precision="0" :controls="false" :min="1" />
-                                </el-form-item>
+                              <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
+                                {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
                               </div>
                             </template>
                           </el-table-column>
+                          <el-table-column prop="productColor" label="颜色" width="170" />
+                          <el-table-column prop="quantity" label="数量" width="100" />
+                          <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                          <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                          <el-table-column prop="remark" label="备注" min-width="150" />
                         </el-table>
                       </div>
 
@@ -680,7 +746,7 @@
                       </div>
 
                       <div style="width:100%;padding-left:15px">
-                        <div class="small-title">
+                        <!-- <div class="small-title">
                           ① 工艺线路
                         </div>
                         <el-row style="width:100%">
@@ -692,9 +758,9 @@
                               </el-select>
                             </el-form-item>
                           </el-col>
-                        </el-row>
+                        </el-row> -->
                         <div class="small-title">
-                           LOGO
+                           LOGO
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -732,7 +798,7 @@
                           </el-col>
                         </el-row>
                         <div class="small-title">
-                           折叠
+                           折叠
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -753,7 +819,7 @@
                           </el-col>
                         </el-row>
                         <div class="small-title">
-                           包装要求
+                           包装要求
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -765,7 +831,7 @@
                           </el-col>
                         </el-row>
                         <div class="small-title">
-                           是否定制
+                           是否定制
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -887,38 +953,20 @@
                   <el-form disabled label-width="100px">
                     <div style="width:100%">
                       <div style="margin:10px 0">
-                        <TitleInfo :content="'主材'"></TitleInfo>
+                        <TitleInfo :content="'基本信息'"></TitleInfo>
                       </div>
                       <div style="width: 100%;padding-left:15px">
                         <el-row>
-                          <el-col :span="12">
+                          <!-- <el-col :span="12">
                             <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId"
                                           :inline-message="true" label="原材料" class="wid100">
                               <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
                                 <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
                               </el-select>
                             </el-form-item>
-                          </el-col>
-                          <el-col :span="12">
-                            <el-form-item label="颜色" class="margin-b-0 wid100">
-                              <el-row style="width: 100%">
-                                <el-col :span="12">
-                                  <el-form-item prop="productColor" label-width="0px" class="margin-b-0 wid100">
-                                    <el-input v-model="product.productColor" placeholder="颜色" />
-                                  </el-form-item>
-                                </el-col>
-                                <el-col :span="12">
-                                  <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
-                                    <el-input v-model="product.colorCardCode" placeholder="色卡号" />
-                                  </el-form-item>
-                                </el-col>
-                              </el-row>
-                            </el-form-item>
-                          </el-col>
-                        </el-row>
-                        <el-row>
+                          </el-col> -->
                           <el-col :span="12">
-                            <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                            <el-form-item label="尺寸" required>
                               <el-row style="width:100%">
                                 <el-col :span="8">
                                   <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
@@ -945,6 +993,25 @@
                             </el-form-item>
                           </el-col>
                           <el-col :span="12">
+                            <el-form-item label="颜色" class="margin-b-0 wid100">
+                              <el-row style="width: 100%">
+                                <el-col :span="12">
+                                  <el-form-item prop="productColor" label-width="0px" class="margin-b-0 wid100">
+                                    <el-input v-model="product.productColor" placeholder="颜色" />
+                                  </el-form-item>
+                                </el-col>
+                                <el-col :span="12">
+                                  <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
+                                    <el-input v-model="product.colorCardCode" placeholder="色卡号" />
+                                  </el-form-item>
+                                </el-col>
+                              </el-row>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+                        <el-row>
+
+                          <el-col :span="12">
                             <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
                               <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
                                                :min="0" onmousewheel="return false;" />
@@ -955,10 +1022,10 @@
                       </div>
 
                       <div style="margin:10px 0">
-                        <TitleInfo :content="'辅材'"></TitleInfo>
+                        <TitleInfo :content="'BOM'"></TitleInfo>
                       </div>
                       <div style="width: 100%;padding-left:15px">
-                        <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
+                        <!-- <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
                           <el-table-column prop="productName" label="物料名称" />
                           <el-table-column prop="productCode" label="物料编码" />
                           <el-table-column label="数量" width="150">
@@ -972,6 +1039,22 @@
                               </div>
                             </template>
                           </el-table-column>
+                        </el-table> -->
+                        <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
+                          <el-table-column prop="productName" label="物料名称" width="170" />
+                          <el-table-column prop="productCode" label="物料编码" width="180" />
+                          <el-table-column label="规格尺寸(cm)" width="130">
+                            <template #default="{ row, $index }">
+                              <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
+                                {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
+                              </div>
+                            </template>
+                          </el-table-column>
+                          <el-table-column prop="productColor" label="颜色" width="170" />
+                          <el-table-column prop="quantity" label="数量" width="100" />
+                          <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                          <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                          <el-table-column prop="remark" label="备注" min-width="150" />
                         </el-table>
                       </div>
 
@@ -980,7 +1063,7 @@
                       </div>
 
                       <div style="width:100%;padding-left:15px">
-                        <div class="small-title">
+                        <!-- <div class="small-title">
                           ① 工艺线路
                         </div>
                         <el-row style="width:100%">
@@ -992,9 +1075,9 @@
                               </el-select>
                             </el-form-item>
                           </el-col>
-                        </el-row>
+                        </el-row> -->
                         <div class="small-title">
-                           LOGO
+                           LOGO
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -1032,7 +1115,7 @@
                           </el-col>
                         </el-row>
                         <div class="small-title">
-                           折叠
+                           折叠
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -1053,7 +1136,7 @@
                           </el-col>
                         </el-row>
                         <div class="small-title">
-                           包装要求
+                           包装要求
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -1065,7 +1148,7 @@
                           </el-col>
                         </el-row>
                         <div class="small-title">
-                           是否定制
+                           是否定制
                         </div>
                         <el-row style="width:100%">
                           <el-col :span="12">
@@ -1128,6 +1211,20 @@
       </template>
     </el-dialog>
 
+    <el-dialog :title="'原材料选择'" v-model="openSelectRawMaterial" width="90%" destroy-on-close>
+      <SelectMaterial :ancestors="100" @selectMaterial="selectRawMaterial"></SelectMaterial>
+      <template #footer>
+        <el-button @click="openSelectRawMaterial = false" size="defualt" v-debounce>取 消</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="'工艺选择'" v-model="openSelectTechnology" width="90%" destroy-on-close>
+      <SelectTechnology :isSelect="true" @selectTechnology="selectTechnology"></SelectTechnology>
+      <template #footer>
+        <el-button @click="openSelectTechnology = false" size="defualt" v-debounce>取 消</el-button>
+      </template>
+    </el-dialog>
+
     <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
       <SelectMaterial :isNeRawMaterial="'1'" @selectMaterial="selectMaterial"></SelectMaterial>
       <template #footer>
@@ -1175,6 +1272,7 @@ import SelectProduct from "@/components/product/SelectProduct.vue";
 import SelectMaterial from "@/components/product/SelectMaterial.vue";
 import * as echarts from "echarts";
 import PriceSheetDetailList from "@/views/EHSD/saleContract/PriceSheetDetailList";
+import SelectTechnology from "@/views/production/project/technology/index.vue";
 
 const { proxy } = getCurrentInstance();
 const uploadData = ref({});
@@ -1821,6 +1919,10 @@ const rules = ref({
     { required: true, message: "请选择客户公司", trigger: "change" },
   ],
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  standardDosage: [
+    { required: true, message: "请输入标准用量", trigger: "blur" },
+  ],
+  lossRate: [{ required: true, message: "请输入损耗率", trigger: "blur" }],
   productLength: [
     { required: true, message: "请输入长 (cm)", trigger: "blur" },
   ],
@@ -2002,9 +2104,10 @@ const selectProduct = (row) => {
           foldWay: goods.foldWay,
           packAsk: packAsk,
           isCustomized: goods.isCustomized || 0,
-          quotationProductBomList: goods.productBomDetailList.filter(
-            (x) => x.type == 2
-          ),
+          // quotationProductBomList: goods.productBomDetailList.filter(
+          //   (x) => x.type == 2
+          // ),
+          quotationProductBomList: goods.productBomDetailList,
           quotationProductCustomInfoList: quotationProductCustomInfoList,
         });
         activeNames.value.push(formData.data.quotationProductList.length - 1);
@@ -2140,37 +2243,6 @@ const handleRemoveBom = (index, sonIndex) => {
   );
 };
 
-const selectMaterial = (goods) => {
-  let flag = formData.data.quotationProductList[
-    indexValue.value
-  ].quotationProductBomList.some((x) => x.materialId == goods.id);
-  if (!flag) {
-    let fileUrl = "";
-    if (goods.fileList && goods.fileList.length > 0) {
-      fileUrl = goods.fileList[0].fileUrl;
-    }
-    formData.data.quotationProductList[
-      indexValue.value
-    ].quotationProductBomList.push({
-      fileUrl: fileUrl,
-      materialId: goods.id,
-      materialName: goods.name,
-      materialCode: goods.customCode,
-      // productLength: goods["length"],
-      // productWidth: goods.width,
-      // productHeight: goods.height,
-      quantity: null,
-      price: null,
-      amount: "",
-      fileList: [],
-      type: 2,
-    });
-    proxy.msgTip("选择成功");
-  } else {
-    proxy.msgTip("该物料已选择", 2);
-  }
-};
-
 // const selectMaterial = (goods) => {
 //   let flag = formData.data.quotationProductList[
 //     indexValue.value
@@ -2537,18 +2609,18 @@ const handleForeign = (row) => {
         } else {
           iele.packAsk = [];
         }
-        if (
-          iele.quotationProductBomList &&
-          iele.quotationProductBomList.length > 0
-        ) {
-          iele.quotationProductBomList = iele.quotationProductBomList
-            .filter((x) => x.type == 2)
-            .map((x) => ({
-              ...x,
-              materialName: x.productName,
-              materialCode: x.productCode,
-            }));
-        }
+        // if (
+        //   iele.quotationProductBomList &&
+        //   iele.quotationProductBomList.length > 0
+        // ) {
+        //   iele.quotationProductBomList = iele.quotationProductBomList
+        //     .filter((x) => x.type == 2)
+        //     .map((x) => ({
+        //       ...x,
+        //       materialName: x.productName,
+        //       materialCode: x.productCode,
+        //     }));
+        // }
         if (
           iele.quotationProductCustomInfoList &&
           iele.quotationProductCustomInfoList.length > 0
@@ -2851,7 +2923,7 @@ const changeMinPrice = () => {
 const isDetailData = ref(false);
 const getConfirmDtl = (row, flag) => {
   if (!proxy.useUserStore().roles.includes("GM")) {
-    return;
+    return proxy.msgTip("您的身份不对,无法进行确认", 2);
   }
   isDetailData.value = flag;
   formOptionTwo.disabled = flag;
@@ -2881,18 +2953,18 @@ const getConfirmDtl = (row, flag) => {
         } else {
           iele.packAsk = [];
         }
-        if (
-          iele.quotationProductBomList &&
-          iele.quotationProductBomList.length > 0
-        ) {
-          iele.quotationProductBomList = iele.quotationProductBomList
-            .filter((x) => x.type == 2)
-            .map((x) => ({
-              ...x,
-              materialName: x.productName,
-              materialCode: x.productCode,
-            }));
-        }
+        // if (
+        //   iele.quotationProductBomList &&
+        //   iele.quotationProductBomList.length > 0
+        // ) {
+        //   iele.quotationProductBomList = iele.quotationProductBomList
+        //     .filter((x) => x.type == 2)
+        //     .map((x) => ({
+        //       ...x,
+        //       materialName: x.productName,
+        //       materialCode: x.productCode,
+        //     }));
+        // }
         if (
           iele.quotationProductCustomInfoList &&
           iele.quotationProductCustomInfoList.length > 0
@@ -3125,6 +3197,146 @@ const handleOfCompanyIdChange = (val) => {
       });
   }
 };
+
+const dialogOpenType = ref(-1);
+const openSelectRawMaterial = ref(false);
+const openSelectTechnology = ref(false);
+const openDialog = (index, type) => {
+  indexValue.value = index;
+  dialogOpenType.value = type;
+  if (type == 1) {
+    openSelectRawMaterial.value = true;
+  }
+  if (type == 2) {
+    openSelectTechnology.value = true;
+  }
+  if (type == 3) {
+    handleClickSelectMaterial(index);
+  }
+};
+
+const selectRawMaterial = (row) => {
+  // formData.data.rawMaterialId = row.id;
+  // formData.data.rawMaterialIdLabel = row.name + "," + row.customCode;
+  // formData.data.rawMaterialSize = `${row["length"]}*${row.width}*${row.height}`;
+  // formData.data.rawMaterialColor = row.color;
+
+  // formData.data.rawMaterialList = [
+  //   {
+  //     rawMaterialName: row.name,
+  //     rawMaterialCode: row.customCode,
+  //     rawMaterialLength: row["length"],
+  //     rawMaterialWidth: row.width,
+  //     rawMaterialHeight: row.height,
+  //     rawMaterialColor: row.color,
+  //   },
+  // ];
+  // openSelectRawMaterial.value = false;
+  if (dialogOpenType.value == 1) {
+    let flag = formData.data.quotationProductList[
+      indexValue.value
+    ].quotationProductBomList.some((x) => x.materialId == row.id);
+    if (!flag) {
+      formData.data.quotationProductList[
+        indexValue.value
+      ].quotationProductBomList.unshift({
+        materialId: row.id,
+        type: 1,
+        materialName: row.name,
+        materialCode: row.customCode,
+        materialLength: row["length"],
+        materialWidth: row.width,
+        materialHeight: row.height,
+        materialColor: row.color,
+        quantity: null,
+        standardDosage: null,
+        lossRate: null,
+        remark: "",
+        price: null,
+        amount: "",
+        fileList: [],
+      });
+      proxy.msgTip("选择成功");
+    } else {
+      proxy.msgTip("该物料已选择", 2);
+    }
+  }
+};
+
+const selectTechnology = (row) => {
+  if (
+    dialogOpenType.value == 2 &&
+    row.processRouteList &&
+    row.processRouteList.length > 0
+  ) {
+    formData.data.quotationProductList[
+      indexValue.value
+    ].quotationProductBomList = formData.data.quotationProductList[
+      indexValue.value
+    ].quotationProductBomList.filter((x) => x.type != 3);
+    let index = formData.data.quotationProductList[
+      indexValue.value
+    ].quotationProductBomList.findIndex((x) => x.type == 2);
+    let arr = row.processRouteList.map((x) => ({
+      type: 3,
+      materialId: x.id,
+      materialName: x.name,
+      quantity: null,
+      standardDosage: null,
+      lossRate: null,
+      remark: "",
+    }));
+
+    if (index >= 0) {
+      formData.data.quotationProductList[
+        indexValue.value
+      ].quotationProductBomList.splice(index, 0, ...arr);
+    } else {
+      let arrLength =
+        formData.data.quotationProductList[indexValue.value]
+          .quotationProductBomList.length;
+      formData.data.quotationProductList[
+        indexValue.value
+      ].quotationProductBomList.splice(arrLength ? arrLength : 0, 0, ...arr);
+    }
+    openSelectTechnology.value = false;
+    return proxy.msgTip("选择成功", 1);
+  }
+};
+
+const selectMaterial = (goods) => {
+  let flag = formData.data.quotationProductList[
+    indexValue.value
+  ].quotationProductBomList.some((x) => x.materialId == goods.id);
+  if (!flag) {
+    let fileUrl = "";
+    if (goods.fileList && goods.fileList.length > 0) {
+      fileUrl = goods.fileList[0].fileUrl;
+    }
+    formData.data.quotationProductList[
+      indexValue.value
+    ].quotationProductBomList.push({
+      fileUrl: fileUrl,
+      materialId: goods.id,
+      materialName: goods.name,
+      materialCode: goods.customCode,
+      materialLength: goods["length"],
+      materialWidth: goods.width,
+      materialHeight: goods.height,
+      quantity: null,
+      standardDosage: null,
+      lossRate: null,
+      remark: "",
+      price: null,
+      amount: "",
+      fileList: [],
+      type: 2,
+    });
+    proxy.msgTip("选择成功");
+  } else {
+    proxy.msgTip("该物料已选择", 2);
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 58 - 60
src/views/EHSD/saleContract/priceSheetEstimate/index.vue

@@ -146,18 +146,18 @@
 
                   <div style="width:100%">
                     <div style="margin:10px 0">
-                      <TitleInfo :content="'主材'"></TitleInfo>
+                      <TitleInfo :content="'基本信息'"></TitleInfo>
                     </div>
                     <div style="width: 100%;padding-left:15px">
                       <el-row>
-                        <el-col :span="12">
+                        <!-- <el-col :span="12">
                           <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId" :inline-message="true"
                                         label="原材料" class="wid100">
                             <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
                               <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
                             </el-select>
                           </el-form-item>
-                        </el-col>
+                        </el-col> -->
                         <el-col :span="12">
                           <el-form-item label="颜色" class="margin-b-0 wid100">
                             <el-row style="width: 100%">
@@ -174,10 +174,8 @@
                             </el-row>
                           </el-form-item>
                         </el-col>
-                      </el-row>
-                      <el-row>
                         <el-col :span="12">
-                          <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                          <el-form-item label="尺寸" required>
                             <el-row style="width:100%">
                               <el-col :span="8">
                                 <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
@@ -203,8 +201,11 @@
                             </el-row>
                           </el-form-item>
                         </el-col>
+                      </el-row>
+                      <el-row>
+
                         <el-col :span="12">
-                          <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
+                          <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
                             <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
                                              :min="0" onmousewheel="return false;" />
                           </el-form-item>
@@ -214,23 +215,24 @@
                     </div>
 
                     <div style="margin:10px 0">
-                      <TitleInfo :content="'辅材'"></TitleInfo>
+                      <TitleInfo :content="'BOM'"></TitleInfo>
                     </div>
                     <div style="width: 100%;padding-left:15px">
                       <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
-                        <el-table-column prop="productName" label="物料名称" />
-                        <el-table-column prop="productCode" label="物料编码" />
-                        <el-table-column label="数量" width="150">
+                        <el-table-column prop="productName" label="物料名称" width="170" />
+                        <el-table-column prop="productCode" label="物料编码" width="180" />
+                        <el-table-column label="规格尺寸(cm)" width="130">
                           <template #default="{ row, $index }">
-                            <div style="width: 100%">
-                              <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.quantity'"
-                                            :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100" label-width="0px">
-                                <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder=" " style="width: 100%"
-                                                 :precision="0" :controls="false" :min="1" />
-                              </el-form-item>
+                            <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
+                              {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
                             </div>
                           </template>
                         </el-table-column>
+                        <el-table-column prop="productColor" label="颜色" width="170" />
+                        <el-table-column prop="quantity" label="数量" width="100" />
+                        <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                        <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                        <el-table-column prop="remark" label="备注" min-width="150" />
                       </el-table>
                     </div>
 
@@ -239,7 +241,7 @@
                     </div>
 
                     <div style="width:100%;padding-left:15px">
-                      <div class="small-title">
+                      <!-- <div class="small-title">
                         ① 工艺线路
                       </div>
                       <el-row style="width:100%">
@@ -251,9 +253,9 @@
                             </el-select>
                           </el-form-item>
                         </el-col>
-                      </el-row>
+                      </el-row> -->
                       <div class="small-title">
-                         LOGO
+                         LOGO
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -291,7 +293,7 @@
                         </el-col>
                       </el-row>
                       <div class="small-title">
-                         折叠
+                         折叠
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -312,7 +314,7 @@
                         </el-col>
                       </el-row>
                       <div class="small-title">
-                         包装要求
+                         包装要求
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -324,7 +326,7 @@
                         </el-col>
                       </el-row>
                       <div class="small-title">
-                         是否定制
+                         是否定制
                       </div>
                       <el-row style="width:100%">
                         <el-col :span="12">
@@ -666,17 +668,17 @@
         <template #detail>
           <div style="width:100%">
             <div style="margin:10px 0">
-              <TitleInfo :content="'主材'"></TitleInfo>
+              <TitleInfo :content="'基本信息'"></TitleInfo>
             </div>
             <div style="width: 100%;padding-left:15px">
               <el-row>
-                <el-col :span="12">
+                <!-- <el-col :span="12">
                   <el-form-item label="原材料" class="wid100">
                     <el-select v-model="formData.detailsData.rawMaterialId" placeholder=" " style="width:100%">
                       <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
                     </el-select>
                   </el-form-item>
-                </el-col>
+                </el-col> -->
                 <el-col :span="12">
                   <el-form-item label="颜色" class="margin-b-0 wid100">
                     <el-row style="width: 100%">
@@ -693,10 +695,8 @@
                     </el-row>
                   </el-form-item>
                 </el-col>
-              </el-row>
-              <el-row>
                 <el-col :span="12">
-                  <el-form-item label="尺寸" class="margin-b-0 wid100" required>
+                  <el-form-item label="尺寸" required>
                     <el-row style="width:100%">
                       <el-col :span="8">
                         <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength" :inline-message="true"
@@ -722,8 +722,11 @@
                     </el-row>
                   </el-form-item>
                 </el-col>
+              </el-row>
+              <el-row>
+
                 <el-col :span="12">
-                  <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
+                  <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
                     <el-input-number v-model="formData.detailsData.netWeight" placeholder="" style="width: 100%" :precision="2" :controls="false"
                                      :min="0" onmousewheel="return false;" />
                   </el-form-item>
@@ -733,29 +736,24 @@
             </div>
 
             <div style="margin:10px 0">
-              <TitleInfo :content="'辅材'"></TitleInfo>
+              <TitleInfo :content="'BOM'"></TitleInfo>
             </div>
             <div style="width: 100%;padding-left:15px">
-              <!-- <el-button type="primary" @click="handleClickSelectMaterial(index)" plain>选择包材/配件/辅材</el-button> -->
               <el-table :data="formData.detailsData.quotationProductBomList" style="width: 100%;">
-                <el-table-column prop="productName" label="物料名称" min-width="130" />
-                <el-table-column prop="productCode" label="物料编码" width="150" />
-                <el-table-column label="数量" width="150">
+                <el-table-column prop="productName" label="物料名称" width="170" />
+                <el-table-column prop="productCode" label="物料编码" width="180" />
+                <el-table-column label="规格尺寸(cm)" width="130">
                   <template #default="{ row, $index }">
-                    <div style="width: 100%">
-                      <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.quantity'"
-                                    :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
-                        <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="" style="width: 100%" :precision="0"
-                                         :controls="false" :min="1" />
-                      </el-form-item>
+                    <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
+                      {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
                     </div>
                   </template>
                 </el-table-column>
-                <!-- <el-table-column label="操作" width="60" align="center" fixed="right">
-                  <template #default="{ $index }">
-                    <el-button type="primary" link @click="handleRemoveBom(index,$index)">删除</el-button>
-                  </template>
-                </el-table-column> -->
+                <el-table-column prop="productColor" label="颜色" width="170" />
+                <el-table-column prop="quantity" label="数量" width="100" />
+                <el-table-column prop="standardDosage" label="标准用量" width="100" />
+                <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                <el-table-column prop="remark" label="备注" min-width="150" />
               </el-table>
             </div>
 
@@ -764,7 +762,7 @@
             </div>
 
             <div style="width:100%;padding-left:15px">
-              <div class="small-title">
+              <!-- <div class="small-title">
                 ① 工艺线路
               </div>
               <el-row style="width:100%">
@@ -776,9 +774,9 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
-              </el-row>
+              </el-row> -->
               <div class="small-title">
-                 LOGO
+                 LOGO
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -816,7 +814,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 折叠
+                 折叠
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -836,7 +834,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 包装要求
+                 包装要求
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -848,7 +846,7 @@
                 </el-col>
               </el-row>
               <div class="small-title">
-                 是否定制
+                 是否定制
               </div>
               <el-row style="width:100%">
                 <el-col :span="12">
@@ -1403,14 +1401,14 @@ const getDtlOne = (row, flag = false, index = 0) => {
         } else {
           iele.packAsk = [];
         }
-        if (
-          iele.quotationProductBomList &&
-          iele.quotationProductBomList.length > 0
-        ) {
-          iele.quotationProductBomList = iele.quotationProductBomList.filter(
-            (x) => x.type == 2
-          );
-        }
+        // if (
+        //   iele.quotationProductBomList &&
+        //   iele.quotationProductBomList.length > 0
+        // ) {
+        //   iele.quotationProductBomList = iele.quotationProductBomList.filter(
+        //     (x) => x.type == 2
+        //   );
+        // }
         if (
           iele.quotationProductCustomInfoList &&
           iele.quotationProductCustomInfoList.length > 0

+ 91 - 83
src/views/finance/fundManage/costControl/index.vue

@@ -62,7 +62,7 @@ const fundsPaymentMethod = computed(
   () => proxy.useUserStore().allDict["funds_payment_method"]
 );
 const accountList = ref([]);
-const accountCurrency = ref([]);
+const paymentTypeData = ref([]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -128,6 +128,11 @@ const paymentType = ref([
 const selectConfig = computed(() => {
   return [
     {
+      label: "费用类型",
+      prop: "costType",
+      data: paymentTypeData.value,
+    },
+    {
       label: "收支类型",
       prop: "tradeType",
       data: tradeTypeData.value,
@@ -278,84 +283,86 @@ const config = computed(() => {
         fixed: "right",
       },
       renderHTML(row) {
-        return [
-          row.status == 0
-            ? {
-                attrs: {
-                  label: "修改",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  update(row);
-                },
-              }
-            : {},
-          row.status == 0
-            ? {
-                attrs: {
-                  label: "删除",
-                  type: "danger",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  proxy
-                    .msgConfirm()
-                    .then((res) => {
+        return row.createUser == proxy.useUserStore().user.userId
+          ? [
+              row.status == 0
+                ? {
+                    attrs: {
+                      label: "修改",
+                      type: "primary",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      update(row);
+                    },
+                  }
+                : {},
+              row.status == 0
+                ? {
+                    attrs: {
+                      label: "删除",
+                      type: "danger",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
                       proxy
-                        .post("/costControl/delete", {
-                          id: row.id,
-                        })
+                        .msgConfirm()
                         .then((res) => {
-                          proxy.msgTip("操作成功", 1);
-                          getList();
-                        });
-                    })
-                    .catch((err) => {});
-                },
-              }
-            : {},
-          row.status == 10 || row.status == 30
-            ? {
-                attrs: {
-                  label: "作废",
-                  type: "danger",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  proxy
-                    .msgConfirm()
-                    .then((res) => {
-                      proxy
-                        .post("/costControl/cancellation", {
-                          id: row.id,
+                          proxy
+                            .post("/costControl/delete", {
+                              id: row.id,
+                            })
+                            .then((res) => {
+                              proxy.msgTip("操作成功", 1);
+                              getList();
+                            });
                         })
+                        .catch((err) => {});
+                    },
+                  }
+                : {},
+              row.status == 10 || row.status == 30
+                ? {
+                    attrs: {
+                      label: "作废",
+                      type: "danger",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      proxy
+                        .msgConfirm()
                         .then((res) => {
-                          proxy.msgTip("操作成功", 1);
-                          getList();
-                        });
-                    })
-                    .catch((err) => {});
-                },
-              }
-            : {},
-          row.status == 30
-            ? {
-                attrs: {
-                  label: "打印",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  clickPrint(row);
-                },
-              }
-            : {},
-        ];
+                          proxy
+                            .post("/costControl/cancellation", {
+                              id: row.id,
+                            })
+                            .then((res) => {
+                              proxy.msgTip("操作成功", 1);
+                              getList();
+                            });
+                        })
+                        .catch((err) => {});
+                    },
+                  }
+                : {},
+              row.status == 30
+                ? {
+                    attrs: {
+                      label: "打印",
+                      type: "primary",
+                      text: true,
+                    },
+                    el: "button",
+                    click() {
+                      clickPrint(row);
+                    },
+                  }
+                : {},
+            ]
+          : [];
       },
     },
   ];
@@ -474,14 +481,6 @@ const formConfig = computed(() => {
         width: "100%",
       },
     },
-    // {
-    //   type: "select",
-    //   label: "付款金额",
-    //   prop: "currency",
-    //   data: accountCurrency.value,
-    //   itemWidth: 50,
-    //   disabled: true,
-    // },
     {
       type: "number",
       prop: "amount",
@@ -661,6 +660,15 @@ onBeforeUnmount(() => {
 });
 
 const getDict = () => {
+  proxy.post("/paymentType/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    paymentTypeData.value = res.rows.map((item) => {
+      return {
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+
   proxy
     .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
     .then((res) => {

+ 9 - 8
src/views/product/material/index.vue

@@ -659,11 +659,11 @@ const formConfig = computed(() => {
     //   label: "备注",
     //   itemType: "textarea",
     // },
-    {
-      type: "title1",
-      title: "规格",
-      isShow: !isSpecial.value,
-    },
+    // {
+    //   type: "title1",
+    //   title: "规格",
+    //   isShow: !isSpecial.value,
+    // },
     {
       type: "input",
       prop: "color",
@@ -784,6 +784,7 @@ const openModal = () => {
   formData.data = {
     definition: "2",
     fileList: [],
+    productClassifyId: sourceList.value.pagination.productClassifyId || "",
   };
   // if (currencyData.value && currencyData.value.length > 0) {
   //   formData.data.currency = currencyData.value[0].dictKey;
@@ -793,9 +794,9 @@ const openModal = () => {
 
 const submitForm = () => {
   formDom.value.handleSubmit((valid) => {
-    if (!formData.data.fileList.length > 0) {
-      return proxy.msgTip("请上传图片", 2);
-    }
+    // if (!formData.data.fileList.length > 0) {
+    //   return proxy.msgTip("请上传图片", 2);
+    // }
     submitLoading.value = true;
     proxy.post("/productInfo/" + modalType.value, formData.data).then(
       (res) => {

+ 83 - 58
src/views/production/project/technology/index.vue

@@ -7,7 +7,7 @@
           //element talbe事件都能传
           select: select,
         }" :action-list="[
-          {
+         props.isSelect?{}: {
             text: '添加产线',
             action: () => openModal('add'),
           },
@@ -110,6 +110,13 @@ import SelectProduct from "@/components/product/SelectProduct";
 import vueFlow from "@/views/production/project/processConfig/vueFlow.vue";
 
 import { computed, defineComponent, nextTick, ref, toRaw } from "vue";
+const { proxy } = getCurrentInstance();
+const props = defineProps({
+  isSelect: {
+    type: Boolean,
+    default: false,
+  },
+});
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -156,7 +163,7 @@ let rules = ref({
     { required: true, message: "请选择生产任务", trigger: "change" },
   ],
 });
-const { proxy } = getCurrentInstance();
+
 const selectConfig = reactive([
   // {
   //   label: "车间类型",
@@ -213,63 +220,77 @@ const config = computed(() => {
       },
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
-        return [
-          // {
-          //   attrs: {
-          //     label: "产品",
-          //     type: "primary",
-          //     text: true,
-          //   },
-          //   el: "button",
-          //   click() {
-          //     updateProduct(row);
-          //   },
-          // },
-          {
-            attrs: {
-              label: "修改",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
-              label: "删除",
-              type: "danger",
-              text: true,
-            },
-            el: "button",
-            click() {
-              // 弹窗提示是否删除
-              ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
-                // 删除
-                proxy
-                  .post("/technology/delete", {
-                    id: row.id,
-                  })
-                  .then((res) => {
-                    ElMessage({
-                      message: "删除成功",
-                      type: "success",
-                    });
-                    getList();
+        return props.isSelect
+          ? [
+              {
+                attrs: {
+                  label: "选择",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleSelectRow(row);
+                },
+              },
+            ]
+          : [
+              // {
+              //   attrs: {
+              //     label: "产品",
+              //     type: "primary",
+              //     text: true,
+              //   },
+              //   el: "button",
+              //   click() {
+              //     updateProduct(row);
+              //   },
+              // },
+              {
+                attrs: {
+                  label: "修改",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              },
+              {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  // 弹窗提示是否删除
+                  ElMessageBox.confirm(
+                    "此操作将永久删除该数据, 是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "确定",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  ).then(() => {
+                    // 删除
+                    proxy
+                      .post("/technology/delete", {
+                        id: row.id,
+                      })
+                      .then((res) => {
+                        ElMessage({
+                          message: "删除成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
                   });
-              });
-            },
-          },
-        ];
+                },
+              },
+            ];
       },
     },
   ];
@@ -545,6 +566,10 @@ const swapItems = (sourceKey, targetKey) => {
   selectLine.value[sourceIndex] = selectLine.value[targetIndex];
   selectLine.value[targetIndex] = temp;
 };
+
+const handleSelectRow = (row) => {
+  proxy.$emit("selectTechnology", row);
+};
 </script>
   
 <style lang="scss" scoped>

+ 27 - 0
src/views/systemTenant/tenant/roleTenant/index.vue

@@ -41,6 +41,7 @@ const defaultProps = {
   children: "children",
   label: "label",
 };
+const roleData = ref([]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -153,6 +154,25 @@ const config = computed(() => {
     },
   ];
 });
+
+const getDict = () => {
+  proxy
+    .get(
+      `/tenantRole/list?pageNum=1&pageSize=10000&tenantId=${sourceList.value.pagination.tenantId}`
+    )
+    .then((message) => {
+      roleData.value = message.rows.map((item) => {
+        return {
+          ...item,
+          id: item.roleId,
+          label: item.roleName,
+        };
+      });
+      roleData.value.unshift({ label: "无", id: "99" });
+      roleData.value.unshift({ label: "顶级", id: "0" });
+    });
+};
+getDict();
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -200,6 +220,13 @@ const formConfig = computed(() => {
       prop: "roleName",
       label: "角色名称",
     },
+    {
+      type: "select",
+      label: "上级角色",
+      prop: "parentId",
+      clearable: true,
+      data: roleData.value,
+    },
     // {
     //   type: "select",
     //   prop: "authorityLv",