695593266@qq.com пре 1 месец
родитељ
комит
c29c3ee995

+ 11 - 5
src/views/material/product/components/BoatInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="100px" ref="form" :model="form">
       <div class="divider">
         <div class="title">
@@ -11,38 +12,39 @@
       <el-row :gutter="24">
         <el-col :span="8">
           <el-form-item label="槽数" prop="slotNum">
-            <el-input v-model="form.slotNum" @input="handleInput1" />
+            <el-input v-model="form.slotNum" @input="handleInput1" :disabled="disabled" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="角度" prop="angle">
-            <DictSelection dictName="角度" clearable v-model="form.angle">
+            <DictSelection dictName="角度" clearable v-model="form.angle" :disabled="disabled">
             </DictSelection>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="长" prop="palletLen">
-            <el-input v-model="form.palletLen" @input="handleInput2">
+            <el-input v-model="form.palletLen" @input="handleInput2" :disabled="disabled">
               <template slot="append">mm</template>
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="宽" prop="wilde">
-            <el-input v-model="form.wilde" @input="handleInput3">
+            <el-input v-model="form.wilde" @input="handleInput3" :disabled="disabled">
               <template slot="append">mm</template>
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="高" prop="hight">
-            <el-input v-model="form.hight" @input="handleInput4">
+            <el-input v-model="form.hight" @input="handleInput4" :disabled="disabled">
               <template slot="append">mm</template>
             </el-input>
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -52,6 +54,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: {},

+ 18 - 11
src/views/material/product/components/MoldInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="100px" ref="form" :model="form">
       <div class="divider">
         <div class="title">
@@ -15,6 +16,7 @@
               v-model="form.shrinkEffictive"
               @input="handleInput1"
               placeholder="请输入"
+              :disabled="disabled"
             >
               <template #append>%</template>
             </el-input>
@@ -22,42 +24,42 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="芯杆数量" prop="coreBarNum">
-            <el-input v-model="form.coreBarNum" @input="handleInput2" />
+            <el-input v-model="form.coreBarNum" @input="handleInput2" :disabled="disabled" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="模孔数量" prop="dieHoleNum">
-            <el-input v-model="form.dieHoleNum" @input="handleInput3">
+            <el-input v-model="form.dieHoleNum" @input="handleInput3" :disabled="disabled">
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="上冲头数量" prop="upperPunchNum">
-            <el-input v-model="form.upperPunchNum" @input="handleInput4">
+            <el-input v-model="form.upperPunchNum" @input="handleInput4" :disabled="disabled">
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="下冲头数量" prop="downPunchNum">
-            <el-input v-model="form.downPunchNum" @input="handleInput5">
+            <el-input v-model="form.downPunchNum" @input="handleInput5" :disabled="disabled">
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="最大冲压次数" prop="maxCyTimes">
-            <el-input v-model="form.maxCyTimes" @input="handleInput6">
+            <el-input v-model="form.maxCyTimes" @input="handleInput6" :disabled="disabled">
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="大模体型号" prop="maxMoldType">
-            <el-input v-model="form.maxMoldType"> </el-input>
+            <el-input v-model="form.maxMoldType" :disabled="disabled"> </el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item label="芯棒直径" prop="mandrelDiameter">
-            <el-input v-model="form.mandrelDiameter" @input="handleInput7">
+            <el-input v-model="form.mandrelDiameter" @input="handleInput7" :disabled="disabled">
             </el-input>
           </el-form-item>
         </el-col>
@@ -65,24 +67,24 @@
         <el-col :span="24">
           <div class="rx-sc">
             <el-form-item label="长" prop="length">
-              <el-input v-model="form.length" @input="handleInput8">
+              <el-input v-model="form.length" @input="handleInput8" :disabled="disabled">
                 <template slot="append">mm</template>
               </el-input>
             </el-form-item>
 
             <el-form-item label="宽" prop="breadth">
-              <el-input v-model="form.breadth" @input="handleInput9">
+              <el-input v-model="form.breadth" @input="handleInput9" :disabled="disabled">
                 <template slot="append">mm</template>
               </el-input>
             </el-form-item>
 
             <el-form-item label="高" prop="altitude">
-              <el-input v-model="form.altitude" @input="handleInput10">
+              <el-input v-model="form.altitude" @input="handleInput10" :disabled="disabled">
                 <template slot="append">mm</template>
               </el-input>
             </el-form-item>
             <el-form-item label="直径" prop="diameter">
-              <el-input v-model="form.diameter" @input="handleInput11">
+              <el-input v-model="form.diameter" @input="handleInput11" :disabled="disabled">
                 <template slot="append">mm</template>
               </el-input>
             </el-form-item>
@@ -90,6 +92,7 @@
         </el-col>
       </el-row>
     </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -99,6 +102,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: {},

+ 12 - 4
src/views/material/product/components/PlanInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="100px" ref="form" :model="form">
       <div class="divider">
         <div class="title">
@@ -11,17 +12,17 @@
       <el-row :gutter="24">
         <el-col :span="8">
           <el-form-item label="固定提前期" prop="fixLeadTime">
-            <el-input v-model="form.fixLeadTime" @input="inputFix" />
+            <el-input v-model="form.fixLeadTime" @input="inputFix" :disabled="disabled" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="变动提前期" prop="changeLeadTime">
-            <el-input v-model="form.changeLeadTime" @input="inputChange" />
+            <el-input v-model="form.changeLeadTime" @input="inputChange" :disabled="disabled" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="检验提前期" prop="checkLeadTime">
-            <el-input v-model="form.checkLeadTime" @input="inputCheck" />
+            <el-input v-model="form.checkLeadTime" @input="inputCheck" :disabled="disabled" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -31,7 +32,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="提前期单位" prop="unit">
-            <DictSelection dictName="提前期单位" clearable v-model="form.unit">
+            <DictSelection dictName="提前期单位" clearable v-model="form.unit" :disabled="disabled">
             </DictSelection>
           </el-form-item>
         </el-col>
@@ -41,12 +42,14 @@
               <el-input
                 v-model="form.orderIntervalTime"
                 style="width: calc(100% - 100px)"
+                :disabled="disabled"
               />
               <DictSelection
                 dictName="提前期单位"
                 clearable
                 v-model="form.orderIntervalUnit"
                 style="width: 100px"
+                :disabled="disabled"
               >
               </DictSelection>
             </div>
@@ -54,6 +57,7 @@
         </el-col>
       </el-row>
     </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -63,6 +67,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: {},

+ 25 - 18
src/views/material/product/components/ProductionInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="100px" ref="form" :rules="rules" :model="form">
       <div class="divider">
         <div class="title">
@@ -11,32 +12,32 @@
       <el-row :gutter="24">
         <el-col :span="8">
           <el-form-item label="是否齐套件">
-            <el-radio v-model="form.isCompleteSet" :label="1">是</el-radio>
-            <el-radio v-model="form.isCompleteSet" :label="0">否</el-radio>
+            <el-radio v-model="form.isCompleteSet" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isCompleteSet" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="消耗波动" prop="consumWave">
-            <el-input v-model="form.consumWave" @input="handleInput1">
+            <el-input v-model="form.consumWave" @input="handleInput1" :disabled="disabled">
               <template slot="append">%</template>
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="变动损耗率" prop="changeLossRate">
-            <el-input v-model="form.changeLossRate" @input="handleInput2">
+            <el-input v-model="form.changeLossRate" @input="handleInput2" :disabled="disabled">
               <template slot="append">%</template>
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="固定损耗数" prop="fixLossNum">
-            <el-input v-model="form.fixLossNum" @input="handleInput3" />
+            <el-input v-model="form.fixLossNum" @input="handleInput3" :disabled="disabled" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="排程类型" prop="apsType">
-            <DictSelection dictName="排程类型" clearable v-model="form.apsType">
+            <DictSelection dictName="排程类型" clearable v-model="form.apsType" :disabled="disabled">
             </DictSelection>
           </el-form-item>
         </el-col>
@@ -46,6 +47,7 @@
               v-model="form.productionDays"
               @input="handleInput4"
               style="width: 100%"
+              :disabled="disabled"
             >
               <span slot="append">天</span>
             </el-input>
@@ -53,42 +55,43 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="允许改型" prop="isModify">
-            <el-radio v-model="form.isModify" :label="1">是</el-radio>
-            <el-radio v-model="form.isModify" :label="0">否</el-radio>
+            <el-radio v-model="form.isModify" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isModify" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="允许返工返修" prop="isRework">
-            <el-radio v-model="form.isRework" :label="1">是</el-radio>
-            <el-radio v-model="form.isRework" :label="0">否</el-radio>
+            <el-radio v-model="form.isRework" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isRework" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="是否返回料" prop="isRematerial">
-            <el-radio v-model="form.isRematerial" :label="1">是</el-radio>
-            <el-radio v-model="form.isRematerial" :label="0">否</el-radio>
+            <el-radio v-model="form.isRematerial" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isRematerial" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="是否副产品" prop="isByProduct">
-            <el-radio v-model="form.isByProduct" :label="1">是</el-radio>
-            <el-radio v-model="form.isByProduct" :label="0">否</el-radio>
+            <el-radio v-model="form.isByProduct" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isByProduct" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="是否废品" prop="isWaste">
-            <el-radio v-model="form.isWaste" :label="1">是</el-radio>
-            <el-radio v-model="form.isWaste" :label="0">否</el-radio>
+            <el-radio v-model="form.isWaste" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isWaste" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="是否不良品" prop="isDefective">
-            <el-radio v-model="form.isDefective" :label="1">是</el-radio>
-            <el-radio v-model="form.isDefective" :label="0">否</el-radio>
+            <el-radio v-model="form.isDefective" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isDefective" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -102,6 +105,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: { deptSelect, personSelect },

+ 12 - 0
src/views/material/product/components/PurchasingInfo.vue

@@ -16,12 +16,14 @@
               placeholder="请输入"
               @input="handleInput1"
               style="width: calc(100% - 100px)"
+              :disabled="disabled"
             />
             <DictSelection
               dictName="周期单位"
               clearable
               v-model="form.purchasingCycleUnit"
               style="width: 100px"
+              :disabled="disabled"
             >
             </DictSelection>
           </el-form-item>
@@ -33,6 +35,7 @@
               placeholder="请输入"
               @input="handleInput2"
               style="width: 100%"
+              :disabled="disabled"
             />
           </el-form-item>
         </el-col>
@@ -43,12 +46,14 @@
               placeholder="请输入"
               @input="handleInput3"
               style="width: calc(100% - 100px)"
+              :disabled="disabled"
             />
             <DictSelection
               dictName="计量单位"
               clearable
               v-model="form.measuringUnit"
               style="width: 100px"
+              :disabled="disabled"
             >
             </DictSelection>
           </el-form-item>
@@ -69,6 +74,7 @@
               style="width: 100%"
               v-model="form.purchaseOrigins"
               multiple
+              :disabled="disabled"
             >
             </DictSelection>
 
@@ -92,6 +98,7 @@
             <deptSelect
               v-model="form.checkDepart"
               @changeGroup="searchDeptNodeClick"
+              :disabled="disabled"
             />
           </el-form-item>
         </el-col>
@@ -101,6 +108,7 @@
               ref="directorRef"
               v-model="form.checkPerson"
               :init="false"
+              :disabled="disabled"
             />
           </el-form-item>
         </el-col>
@@ -118,6 +126,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: { deptSelect, personSelect },

+ 8 - 2
src/views/material/product/components/QualityInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="130px" ref="form" :model="form" :rules="rules">
       <div class="divider">
         <div class="title">
@@ -20,8 +21,8 @@
             "
             prop="isComeCheck"
           >
-            <el-radio v-model="item.isComeCheck" :label="1">是</el-radio>
-            <el-radio v-model="item.isComeCheck" :label="0">否</el-radio>
+            <el-radio v-model="item.isComeCheck" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="item.isComeCheck" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <!-- <el-col :span="6" v-if="form.isComeCheck == 1">
@@ -114,6 +115,7 @@
         </el-col> -->
       </el-row>
     </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -125,6 +127,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: {},

+ 8 - 2
src/views/material/product/components/RemarkInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="100px"  ref="form" :model="form">
          <div class="divider">
            <div class="title">
@@ -11,16 +12,17 @@
          <el-row :gutter="24">
            <el-col :span="24">
              <el-form-item label="附件" prop="allowReturns">
-                 <fileMain v-model="form.remarkAttach"  ></fileMain>
+                 <fileMain v-model="form.remarkAttach" :disabled="disabled"></fileMain>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="备注" prop="remark">
-                <el-input  v-model="form.remark" type="textarea" :row="5" resize="none"/>
+                <el-input  v-model="form.remark" type="textarea" :row="5" resize="none" :disabled="disabled"/>
              </el-form-item>
            </el-col>
          </el-row>
       </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -31,6 +33,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     // components: { fileUpload },

+ 5 - 0
src/views/material/product/components/SalesInfos.vue

@@ -15,6 +15,7 @@
               v-model="form.pricingWay"
               placeholder="请选择计价方式"
               style="width: 100%"
+              :disabled="disabled"
             >
               <el-option
                 v-for="item in pricingWayList"
@@ -36,6 +37,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: {},

+ 8 - 1
src/views/material/product/components/TurnoverInfo.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="other">
+    <fieldset :disabled="disabled" style="border: none; padding: 0; margin: 0;">
     <el-form label-width="100px" ref="form" :model="form">
       <div class="divider">
         <div class="title">
@@ -16,14 +17,16 @@
               dictName="周转车材质"
               clearable
               v-model="form.materialQuality"
+              :disabled="disabled"
             >
             </DictSelection>
             <!-- <el-input  v-model="form.materialQuality"/> -->
           </el-form-item>
         </el-col>
-    
+
       </el-row>
     </el-form>
+    </fieldset>
   </div>
 </template>
 
@@ -33,6 +36,10 @@
       form: {
         type: Object,
         default: {}
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     components: {},

+ 29 - 11
src/views/material/product/components/WarehouseInfo.vue

@@ -11,13 +11,13 @@
       <el-row :gutter="24">
         <el-col :span="8">
           <el-form-item label="启用库存预警" prop="isWarn">
-            <el-radio v-model="form.isWarn" :label="1">是</el-radio>
-            <el-radio v-model="form.isWarn" :label="0">否</el-radio>
+            <el-radio v-model="form.isWarn" :label="1" :disabled="disabled">是</el-radio>
+            <el-radio v-model="form.isWarn" :label="0" :disabled="disabled">否</el-radio>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="盘点模式" prop="inventoryMode">
-            <el-radio-group v-model="form.inventoryMode">
+            <el-radio-group v-model="form.inventoryMode" :disabled="disabled">
               <el-radio :label="1">批量盘点</el-radio>
               <el-radio :label="0">逐个盘点</el-radio>
             </el-radio-group>
@@ -29,6 +29,7 @@
               v-model="form.isUnpack"
               :active-value="1"
               :inactive-value="0"
+              :disabled="disabled"
             >
             </el-switch>
           </el-form-item>
@@ -43,7 +44,7 @@
               trigger: 'blur'
             }"
           >
-            <el-input v-model="form.secureInventory" @input="handleInput1">
+            <el-input v-model="form.secureInventory" @input="handleInput1" :disabled="disabled">
               <template #append>
                 {{ measuringUnit }}
               </template>
@@ -60,7 +61,7 @@
               trigger: 'blur'
             }"
           >
-            <el-input v-model="form.minInventory" @input="handleInput2">
+            <el-input v-model="form.minInventory" @input="handleInput2" :disabled="disabled">
               <template #append>
                 {{ measuringUnit }}
               </template>
@@ -77,7 +78,7 @@
               trigger: 'blur'
             }"
           >
-            <el-input v-model="form.maxInventory" @input="handleInput3">
+            <el-input v-model="form.maxInventory" @input="handleInput3" :disabled="disabled">
               <template #append>
                 {{ measuringUnit }}
               </template>
@@ -91,6 +92,7 @@
               dictName="质保预警参考"
               clearable
               v-model="form.warrantyWarnRefer"
+              :disabled="disabled"
             >
             </DictSelection>
           </el-form-item>
@@ -110,12 +112,14 @@
                 v-model="form.warrantyPeriod"
                 @input="handleInput4"
                 style="width: calc(100% - 100px)"
+                :disabled="disabled"
               />
               <DictSelection
                 dictName="保质期单位"
                 clearable
                 v-model="form.warrantyPeriodUnit"
                 style="width: 100px"
+                :disabled="disabled"
               >
               </DictSelection>
             </div>
@@ -123,7 +127,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="默认仓库" prop="warehouseId">
-            <el-select v-model="form.warehouseId"  style="width: 100%">
+            <el-select v-model="form.warehouseId"  style="width: 100%" :disabled="disabled">
               <el-option
                 v-for="item in warehouseList"
                 :value="item.id"
@@ -135,12 +139,12 @@
         </el-col>
       </el-row>
       <div class="rules_box">
-        <el-button type="primary" @click="addPackingRules"
+        <el-button type="primary" @click="addPackingRules" v-if="!disabled"
           >添加包装组</el-button
         >
         <el-tabs
           v-model="packingRules"
-          editable
+          :editable="!disabled"
           @tab-click="handleClick"
           @edit="handleTabsEdit"
         >
@@ -159,7 +163,7 @@
                 </el-col>
                 <el-col :span="8">
                   <el-form-item label="名称">
-                    <el-input v-model="items.name"></el-input>
+                    <el-input v-model="items.name" :disabled="disabled"></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="8">
@@ -167,6 +171,7 @@
                     <el-radio-group
                       v-model="items.status"
                       @input="statusChange($event, indexs)"
+                      :disabled="disabled"
                     >
                       <el-radio :label="1">是</el-radio>
                       <el-radio :label="0">否</el-radio>
@@ -180,6 +185,7 @@
                       v-model="items.minPackageCell"
                       placeholder="请输入内容"
                       type="number"
+                      :disabled="disabled"
                     ></el-input>
                     <div class="packingUnit">
                       <DictSelection
@@ -187,6 +193,7 @@
                         clearable
                         v-model="items.packageUnit"
                         :isProhibit="true"
+                        :disabled="disabled"
                       >
                       </DictSelection>
                     </div>
@@ -196,6 +203,7 @@
                         dictName="计量单位"
                         clearable
                         v-model="items.minConversionUnit"
+                        :disabled="disabled"
                       >
                       </DictSelection>
                     </div>
@@ -208,12 +216,14 @@
                       v-model="items.inPackageCell"
                       placeholder="请输入内容"
                       type="number"
+                      :disabled="disabled"
                     ></el-input>
                     <div class="packingUnit">
                       <DictSelection
                         dictName="计量单位"
                         clearable
                         v-model="items.minConversionUnit"
+                        :disabled="disabled"
                       >
                       </DictSelection>
                     </div>
@@ -223,6 +233,7 @@
                         dictName="计量单位"
                         clearable
                         v-model="items.inConversionUnit"
+                        :disabled="disabled"
                       >
                       </DictSelection>
                     </div>
@@ -235,12 +246,14 @@
                       v-model="items.outPackageCell"
                       placeholder="请输入内容"
                       type="number"
+                      :disabled="disabled"
                     ></el-input>
                     <div class="packingUnit">
                       <DictSelection
                         dictName="计量单位"
                         clearable
                         v-model="items.inConversionUnit"
+                        :disabled="disabled"
                       >
                       </DictSelection>
                     </div>
@@ -250,6 +263,7 @@
                         dictName="计量单位"
                         clearable
                         v-model="items.outConversionUnit"
+                        :disabled="disabled"
                       >
                       </DictSelection>
                     </div>
@@ -266,7 +280,7 @@
         <el-row :gutter="24">
           <el-col :span="12">
             <el-form-item label="包装名称">
-              <el-input v-model="ruleItem.name"></el-input>
+              <el-input v-model="ruleItem.name" :disabled="disabled"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -312,6 +326,10 @@
         default() {
           return '';
         }
+      },
+      disabled: {
+        type: Boolean,
+        default: false
       }
     },
     watch: {

+ 31 - 4
src/views/material/product/components/index-data.vue

@@ -155,6 +155,18 @@
         </div>
       </template>
 
+      <template v-slot:code="{ row }">
+        <el-link type="primary" :underline="false" @click="openEdit(row, 3)">
+          {{ row.code }}
+        </el-link>
+      </template>
+
+      <template v-slot:name="{ row }">
+        <el-link type="primary" :underline="false" @click="openEdit(row, 3)">
+          {{ row.name }}
+        </el-link>
+      </template>
+
       <template v-slot:componentAttribute="{ row }">
         <div>
           <!-- {{ }} -->
@@ -179,6 +191,9 @@
         >
           复制
         </el-link>
+        <!-- <el-link type="primary" :underline="false" @click="openEdit(row, 3)">
+          详情
+        </el-link> -->
         <el-link
           type="primary"
           :underline="false"
@@ -311,7 +326,10 @@
     <!-- 产品管理 -->
     <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
     <DialogMoveTo ref="DialogMoveToRef" @success="success"></DialogMoveTo>
-    <warehouseDialog ref="warehouseDialogRef" @success="success"></warehouseDialog>
+    <warehouseDialog
+      ref="warehouseDialogRef"
+      @success="success"
+    ></warehouseDialog>
   </div>
 </template>
 
@@ -398,7 +416,8 @@
       goodsAllocation,
       aridRegion,
       BomDetailsPop,
-      DialogMoveTo,warehouseDialog
+      DialogMoveTo,
+      warehouseDialog
     },
     props: {
       // 物料组id
@@ -451,14 +470,16 @@
             align: 'center',
             showOverflowTooltip: true,
             sortable: true,
-            minWidth: 110
+            minWidth: 110,
+            slot: 'code'
           },
           {
             prop: 'name',
             label: '名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            slot: 'name'
           },
           {
             prop: 'categoryLevelPath',
@@ -927,8 +948,13 @@
       openEdit(row, status) {
         console.log(status, this.currentData, 'status');
         let isUpdate;
+        let readOnly = false;
         if (status == 2) {
           isUpdate = 0;
+        } else if (status == 3) {
+          // 详情模式:只读
+          isUpdate = 0;
+          readOnly = true;
         } else {
           isUpdate = 1;
         }
@@ -941,6 +967,7 @@
             status: status,
             rootId: this.rootId,
             isUpdate: isUpdate,
+            readOnly: readOnly,
             oneProduct: this.oneProduct,
             t: new Date().getTime(),
             rootTreeId: this.rootTreeId,

+ 9 - 4
src/views/material/product/components/link-msg.vue

@@ -47,7 +47,7 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="handParent()"
-              v-if="id"
+              v-if="id && !disabled"
             >
               添加供应商
             </el-button>
@@ -58,6 +58,7 @@
               class="ele-action"
               title="确定要删除此供应商吗?"
               @confirm="deleteSupplie(row)"
+              v-if="!disabled"
             >
               <template v-slot:reference>
                 <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -82,7 +83,7 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="handParent()"
-              v-if="id"
+              v-if="id && !disabled"
             >
               添加生产厂家
             </el-button>
@@ -104,7 +105,7 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="handParent()"
-              v-if="id"
+              v-if="id && !disabled"
             >
               添加客户
             </el-button>
@@ -140,7 +141,11 @@
       id: [Number, String],
       categoryLevelId: [Number, String],
       code: [Number, String],
-      categoryLevelGroupId: [Number, String]
+      categoryLevelGroupId: [Number, String],
+      disabled: {
+        type: Boolean,
+        default: false
+      }
     },
     components: {
       vendorDialog

+ 59 - 29
src/views/material/product/detail.vue

@@ -9,7 +9,11 @@
       >
         <headerTitle title="基本信息">
           <el-button @click="cancel">返回</el-button>
-          <el-button type="primary" @click="submit" :loading="loading"
+          <el-button
+            v-if="!isReadOnly"
+            type="primary"
+            @click="submit"
+            :loading="loading"
             >保存
           </el-button>
         </headerTitle>
@@ -20,6 +24,7 @@
               <el-input
                 v-model="form.categoryLevelName"
                 @click.native="openCategory"
+                :disabled="isReadOnly"
               />
             </el-form-item>
           </el-col>
@@ -33,8 +38,8 @@
                 @click.native="openCode"
                 :disabled="status == 0"
               /> -->
-              <el-input v-model="form.code" :disabled="status == 0">
-                <template slot="append" v-if="status != 0">
+              <el-input v-model="form.code" :disabled="status == 0 || isReadOnly">
+                <template slot="append" v-if="status != 0 && !isReadOnly">
                   <el-link :underline="false" @click.native="getCodeOpen"
                     >申请编码
                   </el-link></template
@@ -45,7 +50,7 @@
 
           <el-col :span="8">
             <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name" />
+              <el-input v-model="form.name" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
 
@@ -61,6 +66,7 @@
                 v-model="form.attributeType"
                 filterable
                 class="ele-block"
+                :disabled="isReadOnly"
               >
                 <el-option
                   v-for="item in attributeList"
@@ -80,6 +86,7 @@
                   v-model="form.componentAttribute"
                   filterable
                   multiple
+                  :disabled="isReadOnly"
                 >
                   <el-option
                     v-for="item in lbjtList"
@@ -111,6 +118,7 @@
                   v-model="form.produceType"
                   filterable
                   @change="produceTypeChange"
+                  :disabled="isReadOnly"
                 >
                   <el-option
                     v-for="item in produceTypeList"
@@ -142,6 +150,7 @@
                 v-model="form.isConsumable"
                 style="width: 100%"
                 @change="changeConsumable"
+                :disabled="isReadOnly"
               >
                 <el-option :value="1" label="批量"></el-option>
                 <el-option :value="0" label="单件"></el-option>
@@ -159,7 +168,7 @@
                 trigger: 'change'
               }"
             >
-              <el-input v-model="form.brandNum" />
+              <el-input v-model="form.brandNum" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -172,7 +181,7 @@
                 trigger: 'change'
               }"
             >
-              <el-input v-model="form.modelType" />
+              <el-input v-model="form.modelType" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
 
@@ -186,7 +195,7 @@
                 trigger: 'change'
               }"
             >
-              <el-input v-model="form.specification" @input="inputSpe" />
+              <el-input v-model="form.specification" @input="inputSpe" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
 
@@ -204,6 +213,7 @@
                 v-model="form.measureType"
                 style="width: 100%"
                 @change="changeMeasureType"
+                :disabled="isReadOnly"
               >
                 <el-option
                   v-for="item in measureTypeList"
@@ -221,6 +231,7 @@
                 clearable
                 v-model="form.measuringUnit"
                 @change="changeUnit"
+                :disabled="isReadOnly"
               >
               </DictSelection>
             </el-form-item>
@@ -233,6 +244,7 @@
                 clearable
                 v-model="form.weightUnit"
                 @change="changeWeightUnit"
+                :disabled="isReadOnly"
               >
               </DictSelection>
             </el-form-item>
@@ -245,6 +257,7 @@
                 clearable
                 v-model="form.packingUnit"
                 @change="changeUnit"
+                :disabled="isReadOnly"
               >
               </DictSelection>
             </el-form-item>
@@ -252,7 +265,7 @@
 
           <el-col :span="8">
             <el-form-item label="面积" prop="area">
-              <el-input v-model="form.area" />
+              <el-input v-model="form.area" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
 
@@ -262,6 +275,7 @@
                 dictName="计量单位"
                 clearable
                 v-model="form.areaUnit"
+                :disabled="isReadOnly"
               >
               </DictSelection>
             </el-form-item>
@@ -277,7 +291,7 @@
                 trigger: 'change'
               }"
             >
-              <el-input v-model="form.imgCode" />
+              <el-input v-model="form.imgCode" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
 
@@ -292,7 +306,7 @@
               }"
             >
               <div class="form-line">
-                <el-input v-model="form.roughWeight" @input="handleInput2" />
+                <el-input v-model="form.roughWeight" @input="handleInput2" :disabled="isReadOnly" />
               </div>
             </el-form-item>
           </el-col>
@@ -309,7 +323,7 @@
               }"
             >
               <div class="form-line">
-                <el-input v-model="form.netWeight" @input="handleInput3" />
+                <el-input v-model="form.netWeight" @input="handleInput3" :disabled="isReadOnly" />
               </div>
             </el-form-item>
           </el-col>
@@ -327,6 +341,7 @@
                 <el-input
                   v-model="form.volume"
                   style="width: calc(100% - 100px)"
+                  :disabled="isReadOnly"
                 />
                 <!-- @input="handleInput1" -->
                 <DictSelection
@@ -334,6 +349,7 @@
                   clearable
                   v-model="form.volumeUnit"
                   style="width: 100px"
+                  :disabled="isReadOnly"
                 >
                 </DictSelection>
               </div>
@@ -355,6 +371,7 @@
                   v-model="form.level"
                   placeholder="请选择"
                   @change="levelChange"
+                  :disabled="isReadOnly"
                 >
                   <el-option
                     v-for="item in levelOptions"
@@ -385,6 +402,7 @@
                 filterable
                 allow-create
                 default-first-option
+                :disabled="isReadOnly"
               >
               </DictSelection>
             </el-form-item>
@@ -407,6 +425,7 @@
                 filterable
                 allow-create
                 default-first-option
+                :disabled="isReadOnly"
               >
               </DictSelection>
             </el-form-item>
@@ -419,6 +438,7 @@
                   :active-text="form.isEnabled == 1 ? '启用' : '停用'"
                   :active-value="1"
                   :inactive-value="0"
+                  :disabled="isReadOnly"
                 >
                 </el-switch>
               </template>
@@ -449,10 +469,10 @@
                   <component
                     :is="f.tagType"
                     v-model="form.extField[f.prop]"
-                    :disabled="f.extAttribute?.disabled"
+                    :disabled="f.extAttribute?.disabled || isReadOnly"
                     clearable
                     :isProhibit="
-                      f.modelType == 'dict' ? f.extAttribute?.disabled : false
+                      f.modelType == 'dict' ? f.extAttribute?.disabled || isReadOnly : false
                     "
                     :dictName="f.modelType == 'dict' ? f.label : ''"
                   ></component>
@@ -463,23 +483,23 @@
           <template v-if="industryAttribute == 1">
             <el-col :span="8">
               <el-form-item label="性味与归经">
-                <el-input v-model="form.propertiesChannelTropism" />
+                <el-input v-model="form.propertiesChannelTropism" :disabled="isReadOnly" />
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="功能与主治">
-                <el-input v-model="form.actionsAndUses" />
+                <el-input v-model="form.actionsAndUses" :disabled="isReadOnly" />
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="用法与用量">
-                <el-input v-model="form.usageAndDosage" />
+                <el-input v-model="form.usageAndDosage" :disabled="isReadOnly" />
               </el-form-item>
             </el-col>
           </template>
           <el-col :span="8" v-if="clientEnvironmentId == 5">
             <el-form-item label="需要序列号">
-              <el-radio-group v-model="form.extTagField.needProductSequence">
+              <el-radio-group v-model="form.extTagField.needProductSequence" :disabled="isReadOnly">
                 <el-radio :label="1">是</el-radio>
                 <el-radio :label="0">否</el-radio>
               </el-radio-group>
@@ -487,12 +507,12 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="物联产品Key">
-              <el-input v-model="form.iotProductKey" />
+              <el-input v-model="form.iotProductKey" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
           <el-col :span="24">
             <el-form-item label="产品图片">
-              <ImgUpload ref="imgUploadRef" v-model="form.imgUrl" />
+              <ImgUpload ref="imgUploadRef" v-model="form.imgUrl" :disabled="isReadOnly" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -503,7 +523,7 @@
       <!-- {{ form.extTagField }} -->
       <el-form label-width="100px">
         <el-form-item label="是否消耗品">
-          <el-radio-group v-model="form.extTagField.isConsumables">
+          <el-radio-group v-model="form.extTagField.isConsumables" :disabled="isReadOnly">
             <el-radio :label="1">是</el-radio>
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
@@ -529,26 +549,27 @@
       :packingUnit="form.packingUnit"
       :packageDispositionVOList="packageDispositionVOList"
       @change="changePackagingSpecification"
+      :disabled="isReadOnly"
     />
     <!-- 销售配置 -->
-    <SalesInfos ref="salesRefs" :form="categorySales" />
+    <SalesInfos ref="salesRefs" :form="categorySales" :disabled="isReadOnly" />
     <!-- 采购信息 -->
-    <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" />
+    <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" :disabled="isReadOnly" />
     <!-- 生产信息 -->
-    <ProductionInfo ref="productionRefs" :form="categoryMes" />
+    <ProductionInfo ref="productionRefs" :form="categoryMes" :disabled="isReadOnly" />
     <!-- 计划 -->
-    <PlanInfo ref="planRefs" :form="categoryAps" />
+    <PlanInfo ref="planRefs" :form="categoryAps" :disabled="isReadOnly" />
     <!-- 质量配置 -->
 
-    <QualityInfo ref="qualityRefs" :form="categoryQms" />
+    <QualityInfo ref="qualityRefs" :form="categoryQms" :disabled="isReadOnly" />
     <!-- 舟皿信息 -->
-    <BoatInfo :form="categoryPallet" />
+    <BoatInfo :form="categoryPallet" :disabled="isReadOnly" />
     <!-- 周转车信息 -->
-    <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle" />
+    <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle" :disabled="isReadOnly" />
     <!-- 模具信息 -->
-    <MoldInfo ref="moldRefs" :form="categoryMold" />
+    <MoldInfo ref="moldRefs" :form="categoryMold" :disabled="isReadOnly" />
     <!-- 备注信息 -->
-    <RemarkInfo ref="remarkRefs" :form="remarkform" />
+    <RemarkInfo ref="remarkRefs" :form="remarkform" :disabled="isReadOnly" />
     <!-- 关联信息 -->
     <linkMsg
       ref="linkMsgRef"
@@ -556,6 +577,7 @@
       :categoryLevelId="form.categoryLevelId"
       :categoryLevelGroupId="form.categoryLevelGroupId"
       :code="form.code"
+      :disabled="isReadOnly"
     />
     <!-- 申请编码 -->
 
@@ -680,6 +702,7 @@
     },
     data() {
       return {
+        isReadOnly: false,
         isShow: true,
         produceTypeList,
         packagingSpecificationList: [],
@@ -980,6 +1003,8 @@
     },
     async activated() {
       this.status = this.$route.query.status;
+      this.isReadOnly = this.$route.query.readOnly === 'true' || this.$route.query.readOnly === true;
+      console.log('activated - isReadOnly 状态:', this.isReadOnly, 'readOnly参数:', this.$route.query.readOnly);
       this.form.categoryLevelId = this.$route.query.categoryLevelId;
       this.form.categoryLevelName = this.$route.query.categoryLevelName;
       this.form.categoryLevelPath = this.$route.query.categoryLevelPath;
@@ -1013,6 +1038,9 @@
         }
       });
 
+      this.isReadOnly = this.$route.query.readOnly === 'true' || this.$route.query.readOnly === true;
+      console.log('详情页 isReadOnly 状态:', this.isReadOnly, 'readOnly参数:', this.$route.query.readOnly);
+
       parameterGetByCode({
         code: 'mandatory_field'
       }).then((res) => {
@@ -1412,6 +1440,7 @@
       },
 
       getCodeOpen() {
+        if (this.isReadOnly) return;
         let parentId = [];
         if (this.form.categoryLevelPathId?.length) {
           parentId = this.form.categoryLevelPathId?.split(',');
@@ -1486,6 +1515,7 @@
       },
 
       openCategory() {
+        if (this.isReadOnly) return;
         this.$refs.categoryRefs.open();
       },