695593266@qq.com 9 месяцев назад
Родитель
Сommit
80984ed224

+ 208 - 117
src/views/produce/components/jobBooking/components/batchPackagingGrouping.vue

@@ -1,129 +1,151 @@
 <template>
-  <div
-    v-if="
-      (!objData.isUnpack && objData.isUnpack != 0) || objData.isUnpack == '1'
-    "
-  >
+  <div>
     <div class="col userInp" style="display: flex; align-items: center">
       <div class="label lable150 rx-cc" style="width: 100px !important"
-        >规格选择:</div
+        >是否拆包:</div
       >
-      <el-select
-        v-model="Usertype"
-        placeholder="请选择"
-        @change="changeUserType"
+      <span
+        v-if="objData.isUnpack == '1'"
+        style="
+          color: green;
+          font-size: 14px;
+          font-weight: 700;
+          margin-left: 15px;
+        "
+        >是</span
       >
-        <el-option
-          v-for="item in localdataList"
-          :key="item.value"
-          :label="item.text"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-      <div class="label lable150 rx-cc" style="width: 100px !important"
-        >包装选择:</div
-      >
-      <el-select
-        v-model="warehouseId"
-        placeholder="请选择"
-        @change="changeWarehouseType"
-        disabled
+      <span
+        v-else
+        style="
+          color: green;
+          font-size: 14px;
+          font-weight: 700;
+          margin-left: 15px;
+        "
+        >否</span
       >
-        <el-option
-          v-for="item in warehouseSpecTypeList"
-          :key="item.value"
-          :label="item.text"
-          :value="item.value"
+    </div>
+    <div v-if="objData.isUnpack == '1'">
+      <div class="col userInp" style="display: flex; align-items: center">
+        <div class="label lable150 rx-cc" style="width: 100px !important"
+          >规格选择:</div
+        >
+        <el-select
+          v-model="Usertype"
+          placeholder="请选择"
+          @change="changeUserType"
+        >
+          <el-option
+            v-for="item in localdataList"
+            :key="item.value"
+            :label="item.text"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <div class="label lable150 rx-cc" style="width: 100px !important"
+          >包装选择:</div
         >
-        </el-option>
-      </el-select>
-      <!-- multiple -->
-      <!-- <zxz-uni-data-select :localdata="localdataList" v-model="Usertype"
+        <el-select
+          v-model="warehouseId"
+          placeholder="请选择"
+          @change="changeWarehouseType"
+          disabled
+        >
+          <el-option
+            v-for="item in warehouseSpecTypeList"
+            :key="item.value"
+            :label="item.textValue"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <!-- multiple -->
+        <!-- <zxz-uni-data-select :localdata="localdataList" v-model="Usertype"
 				@change="changeUserType"></zxz-uni-data-select> -->
-    </div>
-    <div v-if="warehouseId != 1">
-      <div v-for="(item, i) in DispositionList" :key="i">
-        <div class="title_box rx-bc mt6">
-          <div class="name">{{ item.titel }}</div>
-
-          <div class="rx-bc"> </div>
-        </div>
+      </div>
+      <div v-if="warehouseId != 1">
+        <div v-for="(item, i) in DispositionList" :key="i">
+          <div class="title_box rx-bc mt6">
+            <div class="name">{{ item.titel }}</div>
 
-        <div>
-          <div class="material">
-            <div class="content_table">
-              <div class="item">
-                <div class="lable rx-cc">包装总数 </div>
-                <div class="content content_num">
-                  <el-input
-                    class="uni-el-input"
-                    v-model="formedNumLast"
-                    type="number"
-                    v-if="i == 0"
-                    @input="changeinput"
-                    disabled
-                    style="width: 200px"
-                  ></el-input>
-                  <el-input
-                    class="uni-el-input"
-                    v-model="item.formedNumLast"
-                    type="number"
-                    v-else
-                    disabled
-                    style="width: 200px"
-                  ></el-input>
-                  <div class="unit">{{ item.packageUnit }}</div>
-                </div>
-              </div>
+            <div class="rx-bc"> </div>
+          </div>
 
-              <div class="item rx-sc">
-                <div class="rx ww55">
-                  <div class="lable lable200 rx-cc">{{ item.titel }}单元</div>
+          <div>
+            <div class="material">
+              <div class="content_table">
+                <div class="item">
+                  <div class="lable rx-cc">包装总数 </div>
                   <div class="content content_num">
                     <el-input
                       class="uni-el-input"
-                      v-model="item.packageCell"
+                      v-model="formedNumLast"
+                      type="number"
+                      v-if="i == 0"
+                      @input="changeinput"
+                      disabled
+                      style="width: 200px"
+                    ></el-input>
+                    <el-input
+                      class="uni-el-input"
+                      v-model="item.formedNumLast"
+                      type="number"
+                      v-else
                       disabled
                       style="width: 200px"
                     ></el-input>
-                    <div class="unit">{{ item.packageUnit }}</div
-                    >/<div class="unit">{{ item.conversionUnit }}</div>
+                    <div class="unit">{{ item.packageUnit }}</div>
                   </div>
                 </div>
-              </div>
-            </div>
 
-            <div v-if="item.splitList.length">
-              <ele-pro-table
-                ref="table"
-                :needPage="false"
-                :columns="columnsMin"
-                :datasource="item.splitList"
-                class="time-form"
-                max-height="400"
-                row-key="index"
-              >
-                <template v-slot:newWeight="{ row, $index }">
-                  <span
-                    >{{ row.extInfo.newWeight
-                    }}{{ row.extInfo.weightUnit }}</span
-                  >
-                </template>
-
-                <template v-slot:reportWeight="{ row, $index }">
-                  <span
-                    >{{ row.extInfo.reportWeight
-                    }}{{ row.extInfo.weightUnit }}</span
-                  >
-                </template>
-              </ele-pro-table>
+                <div class="item rx-sc">
+                  <div class="rx ww55">
+                    <div class="lable lable200 rx-cc">{{ item.titel }}单元</div>
+                    <div class="content content_num">
+                      <el-input
+                        class="uni-el-input"
+                        v-model="item.packageCell"
+                        disabled
+                        style="width: 200px"
+                      ></el-input>
+                      <div class="unit">{{ item.packageUnit }}</div
+                      >/<div class="unit">{{ item.conversionUnit }}</div>
+                    </div>
+                  </div>
+                </div>
+              </div>
 
-              <!-- <template v-slot:newWeight="{ row, $index }">
+              <div v-if="item.splitList.length">
+                <ele-pro-table
+                  ref="table"
+                  :needPage="false"
+                  :columns="columnsMin"
+                  :datasource="item.splitList"
+                  class="time-form"
+                  max-height="400"
+                  row-key="index"
+                >
+                  <template v-slot:newWeight="{ row, $index }">
+                    <span
+                      >{{ row.extInfo.newWeight
+                      }}{{ row.extInfo.weightUnit }}</span
+                    >
+                  </template>
+
+                  <template v-slot:reportWeight="{ row, $index }">
+                    <span
+                      >{{ row.extInfo.reportWeight
+                      }}{{ row.extInfo.weightUnit }}</span
+                    >
+                  </template>
+                </ele-pro-table>
+
+                <!-- <template v-slot:newWeight="{ row, $index }">
                 <span>{{ row.extInfo.newWeight }}</span
                 >{{ row.extInfo.weightUnit }}
               </template> -->
-              <!-- <el-table :data="item.splitList" style="width: 100%">
+                <!-- <el-table :data="item.splitList" style="width: 100%">
               <el-table-column prop="computeSize" label="序号" width="65">
                 <template v-slot="{ row, $index }">
                   {{ $index + 1 }}
@@ -134,11 +156,11 @@
               </el-table-column>
               <el-table-column prop="code" label="条码"> </el-table-column>
             </el-table> -->
+              </div>
             </div>
           </div>
-        </div>
 
-        <!-- <SearchPopup mode="center" v-if='show'>
+          <!-- <SearchPopup mode="center" v-if='show'>
 			<template v-slot:list>
 				<div class="search_list">
 
@@ -173,6 +195,7 @@
 			</template>
 
 </SearchPopup> -->
+        </div>
       </div>
     </div>
   </div>
@@ -257,19 +280,23 @@
         warehouseSpecTypeList: [
           {
             text: '按计量',
-            value: 1
+            value: 1,
+            textValue: '按计量'
           },
           {
             text: '最小包装',
-            value: 2
+            value: 2,
+            textValue: ''
           },
           {
             text: '内包装',
-            value: 3
+            value: 3,
+            textValue: ''
           },
           {
             text: '外包装',
-            value: 4
+            value: 4,
+            textValue: ''
           }
         ],
         cacheKeyUrlMin: 'cacheKeyUrlMin'
@@ -298,10 +325,7 @@
             this.formedNumLast = 0;
           }
           console.log(newVal);
-          if (
-            (!newVal.isUnpack && newVal.isUnpack != 0) ||
-            newVal.isUnpack == '1'
-          ) {
+          if (newVal.isUnpack == '1') {
             this.packageDispositionFn();
           }
         },
@@ -372,7 +396,7 @@
                 ? '半成品'
                 : row.rootCategoryLevelId == 9
                 ? '产品'
-                : item.rootCategoryLevelId == 28
+                : row.rootCategoryLevelId == 28
                 ? '废品'
                 : '';
             }
@@ -612,11 +636,66 @@
           }
           this.selectList = res;
 
+          this.warehouseSpecTypeList.forEach((item) => {
+            if (item.value == 2) {
+              // const num = res[0].packageCell ? res[0].packageCell : '';
+              // const packageUnit = res[0].packageUnit ? res[0].packageUnit : '';
+              // const conversionUnit = res[0].conversionUnit
+              //   ? res[0].conversionUnit
+              //   : '';
+              // let packInfo = '';
+              // if (num) {
+              //   packInfo = num + '/' + packageUnit + '/' + conversionUnit;
+              // }
+              item.textValue = item.text + `(${this.selectPackInfo(res[0])})`;
+            }
+
+            if (item.value == 3) {
+              // const num = res[1].packageCell ? res[1].packageCell : '';
+              // const packageUnit = res[1].packageUnit ? res[1].packageUnit : '';
+              // const conversionUnit = res[1].conversionUnit
+              //   ? res[1].conversionUnit
+              //   : '';
+              // let packInfo = '';
+              // if (num) {
+              //   packInfo = num + '/' + packageUnit + '/' + conversionUnit;
+              // }
+              item.textValue = item.text + `(${this.selectPackInfo(res[1])})`;
+            }
+
+            if (item.value == 4) {
+              // const num = res[2].packageCell ? res[2].packageCell : '';
+              // const packageUnit = res[2].packageUnit ? res[2].packageUnit : '';
+              // const conversionUnit = res[2].conversionUnit
+              //   ? res[2].conversionUnit
+              //   : '';
+              // let packInfo = '';
+              // if (num) {
+              //   packInfo = num + '/' + packageUnit + '/' + conversionUnit;
+              // }
+              item.textValue = item.text + `(${this.selectPackInfo(res[2])})`;
+            }
+          });
+
+          // console.log(res[0], res[1], res[2], '555555554444444');
+
           this.initFn(this.localdataList[0].arr);
           // this.listFn(this.localdataList[0].arr);
         }
       },
 
+      selectPackInfo(data) {
+        const num = data.packageCell ? data.packageCell : '';
+        const packageUnit = data.packageUnit ? data.packageUnit : '';
+        const conversionUnit = data.conversionUnit ? data.conversionUnit : '';
+        let packInfo = '';
+        if (num) {
+          packInfo = num + '/' + packageUnit + '/' + conversionUnit;
+        }
+
+        return packInfo;
+      },
+
       initFn(v) {
         if (v.length) {
           this.withinQuantity = v[1].packageCell; //内包装数量
@@ -892,13 +971,17 @@
               specValue: this.value,
               minimumPackage: this.minimumPackage, // 最小包装
               tier: this.warehouseId,
+              isUnpack: this.objData.isUnpack,
+              packUnitInfo: this.warehouseSpecTypeList[1].textValue,
               minimumPackageCell: this.DispositionList[0].packageCell, // 最小包装
               minimumPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
               minimumConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
               minimumFormedNumLast: this.DispositionList[0].formedNumLast // 总包装数量
             };
           } else {
-            packInfo = {};
+            packInfo = {
+              isUnpack: this.objData.isUnpack
+            };
           }
         } else if (this.warehouseId == 3) {
           if (this.DispositionList && this.DispositionList.length != 0) {
@@ -907,13 +990,17 @@
               specValue: this.value,
               withinPackage: this.withinPackage, // 内包装
               tier: this.warehouseId,
+              isUnpack: this.objData.isUnpack,
+              packUnitInfo: this.warehouseSpecTypeList[2].textValue,
               withinPackageCell: this.DispositionList[0].packageCell, // 最小包装名称
               withinPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
               withinConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
               withinFormedNumLast: this.DispositionList[0].formedNumLast // 总包装数量
             };
           } else {
-            packInfo = {};
+            packInfo = {
+              isUnpack: this.objData.isUnpack
+            };
           }
         } else if (this.warehouseId == 4) {
           if (this.DispositionList && this.DispositionList.length != 0) {
@@ -922,13 +1009,17 @@
               specValue: this.value,
               outsidePackage: this.outsidePackage, //外包装
               tier: this.warehouseId,
+              isUnpack: this.objData.isUnpack,
+              packUnitInfo: this.warehouseSpecTypeList[3].textValue,
               outsidePackageCell: this.DispositionList[0].packageCell, // 最小包装名称
               outsidePackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
               outsideConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
               outsideFormedNumLast: this.DispositionList[0].formedNumLast
             }; // 总包装数量
           } else {
-            packInfo = {};
+            packInfo = {
+              isUnpack: this.objData.isUnpack
+            };
           }
         }
 

+ 55 - 16
src/views/produce/components/jobBooking/components/detailPackagingGrouping.vue

@@ -3,7 +3,37 @@
     <div
       class="col userInp"
       style="display: flex; align-items: center"
-      v-if="!storeType"
+      v-if="objData.packInfo"
+    >
+      <div class="label lable150 rx-cc" style="width: 100px !important"
+        >是否拆包:</div
+      >
+      <span
+        v-if="objData.packInfo.isUnpack == '1'"
+        style="
+          color: green;
+          font-size: 14px;
+          font-weight: 700;
+          margin-left: 15px;
+        "
+        >是</span
+      >
+      <span
+        v-else
+        style="
+          color: green;
+          font-size: 14px;
+          font-weight: 700;
+          margin-left: 15px;
+        "
+        >否</span
+      >
+    </div>
+
+    <div
+      class="col userInp"
+      style="display: flex; align-items: center"
+      v-if="!storeType && objData.packInfo.isUnpack == '1'"
     >
       <div class="label lable150 rx-cc" style="width: 100px !important"
         >规格</div
@@ -19,6 +49,7 @@
         placeholder="请选择"
         @change="changeWarehouseType"
         :disabled="isDetails"
+        v-if="!objData.packInfo.packUnitInfo"
       >
         <el-option
           v-for="item in warehouseSpecTypeList"
@@ -28,11 +59,15 @@
         >
         </el-option>
       </el-select>
+
+      <span v-else>{{
+        objData.packInfo.packUnitInfo ? objData.packInfo.packUnitInfo : ''
+      }}</span>
       <!-- multiple -->
       <!-- <zxz-uni-data-select :localdata="localdataList" v-model="Usertype"
 				@change="changeUserType"></zxz-uni-data-select> -->
     </div>
-    <div v-if="warehouseId != 1">
+    <div v-if="warehouseId != 1 && objData.packInfo.isUnpack == '1'">
       <div v-for="(item, i) in DispositionList" :key="i">
         <div class="title_box rx-bc mt6">
           <div class="name">{{ item.titel }}</div>
@@ -486,21 +521,25 @@
     created() {
       if (this.objData.packInfo && !this.storeType) {
         this.warehouseId = this.objData.packInfo.tier;
-        this.DispositionList.push({
-          titel: '最小包装',
-          splitList: this.objData.packInfo.minimumPackage,
-          packageCell: this.objData.packInfo.minimumPackageCell,
-          packageUnit: this.objData.packInfo.minimumPackageUnit,
-          conversionUnit: this.objData.packInfo.minimumConversionUnit
-        });
+        if (this.objData.packInfo.isUnpack == '1') {
+          this.DispositionList.push({
+            titel: '最小包装',
+            splitList: this.objData.packInfo.minimumPackage,
+            packageCell: this.objData.packInfo.minimumPackageCell,
+            packageUnit: this.objData.packInfo.minimumPackageUnit,
+            conversionUnit: this.objData.packInfo.minimumConversionUnit
+          });
+        }
       } else {
-        this.DispositionList.push({
-          titel: '最小包装',
-          splitList: this.objData.product
-          // packageCell: this.objData.packInfo.minimumPackageCell,
-          // packageUnit: this.objData.packInfo.minimumPackageUnit,
-          // conversionUnit: this.objData.packInfo.minimumConversionUnit
-        });
+        if (this.objData.packInfo.isUnpack == '1') {
+          this.DispositionList.push({
+            titel: '最小包装',
+            splitList: this.objData.product
+            // packageCell: this.objData.packInfo.minimumPackageCell,
+            // packageUnit: this.objData.packInfo.minimumPackageUnit,
+            // conversionUnit: this.objData.packInfo.minimumConversionUnit
+          });
+        }
       }
 
       if (this.objData.product && this.objData.product.length != 0) {

+ 6 - 0
src/views/produce/components/new_produceOrder.vue

@@ -183,6 +183,12 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             prop: 'outsourceStatus',
             label: '委外状态',

+ 1 - 1
src/views/warehousing/index.vue

@@ -31,7 +31,7 @@
         <template v-slot:action="{ row }">
           <el-link
             type="primary"
-            v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
+            v-if="row.approvalStatus == 0"
             :underline="false"
             @click="storage(row)"
           >