Quellcode durchsuchen

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

liujt vor 1 Monat
Ursprung
Commit
9dded6e849

+ 78 - 0
src/directives/tableScrollSync.js

@@ -0,0 +1,78 @@
+// 工具函数:获取 .el-table__body-wrapper 下的滚动容器
+function getBodyWrapper(el) {
+  return el.querySelector('.el-table__body-wrapper');
+}
+
+// 创建滚动条并绑定事件,返回清理函数
+function setupScrollSync(el) {
+  const table = el; // el 就是容器元素
+  if (!table) return null;
+
+  const outerWidth = table.offsetWidth;
+  // 取第一个内部 table 的宽度作为内容宽度
+  const innerTable = table.querySelector('table');
+  const contentWidth = innerTable ? innerTable.offsetWidth : outerWidth;
+
+  const bodyWrapper = getBodyWrapper(table);
+  if (!bodyWrapper) {
+    console.warn('未找到 .el-table__body-wrapper,无法创建滚动同步');
+    return null;
+  }
+  bodyWrapper.style.scrollbarWidth = 'none';
+  bodyWrapper.style.msOverflowStyle = 'none';
+  // 避免重复创建
+  const existingDiv = table.querySelector('.v-scroll-sync-bar');
+  if (existingDiv) existingDiv.remove();
+
+  const div = document.createElement('div');
+  div.className = 'v-scroll-sync-bar';
+  div.style.width = outerWidth + 'px';
+  div.style.height = '12px';
+  div.style.overflowX = 'auto';
+  div.innerHTML = `<div style="width:${contentWidth}px; height:1px;"></div>`;
+
+  const onScroll = () => {
+    bodyWrapper.scrollLeft = div.scrollLeft;
+  };
+  div.addEventListener('scroll', onScroll);
+
+  table.appendChild(div);
+
+  // 返回清理函数和事件引用
+  return {
+    div,
+    handler: onScroll,
+    destroy() {
+      div.removeEventListener('scroll', onScroll);
+      if (div.parentNode) div.parentNode.removeChild(div);
+    }
+  };
+}
+
+// Vue 2 自定义指令
+const tableScrollSync = {
+  bind(el) {
+    // bind 时可能未插入文档,先不做操作,统一在 inserted 中处理
+    el._scrollSyncData = null;
+  },
+  inserted(el) {
+    // 元素插入 DOM 后初始化
+    el._scrollSyncData = setupScrollSync(el);
+  },
+  update(el) {
+    // 当表格数据变化导致内容宽度改变时(如切换分页、动态列),重新初始化
+    if (el._scrollSyncData) {
+      el._scrollSyncData.destroy();
+    }
+    el._scrollSyncData = setupScrollSync(el);
+  },
+  unbind(el) {
+    // 指令解绑时销毁
+    if (el._scrollSyncData) {
+      el._scrollSyncData.destroy();
+      el._scrollSyncData = null;
+    }
+  }
+};
+
+export default tableScrollSync;

+ 2 - 0
src/main.js

@@ -31,7 +31,9 @@ Vue.component('authSelection', authSelection);
 import '@/icons';
 Vue.component('DictSelection', DictSelection);
 Vue.component('seekPage', seekPage);
+import tableScrollSync from '@/directives/tableScrollSync';
 
+Vue.directive('table-scroll-sync', tableScrollSync);
 Vue.config.productionTip = false;
 Vue.prototype.$math = create(all, {
   number: 'BigNumber',

+ 412 - 406
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -1,351 +1,354 @@
 <template>
   <el-form ref="form" :model="form" :rules="rules">
-    <ele-pro-table
-      ref="table"
-      :needPage="false"
-      :columns="columns"
-      :datasource="form.datasource"
-      class="time-form"
-      @columns-change="handleColumnChange"
-      :cache-key="cacheKeyUrl"
-      height="350"
-      full-height="calc(100vh - 76px)"
-      :show-summary="clientEnvironmentId == 4"
-      :summary-method="getSummaries"
-    >
-      <!-- 表头工具栏 -->
-      <template v-slot:toolbar>
-        <div class="headbox">
-          <el-button
-            v-if="isShowAdd && needProduce != 4"
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="handlAdd"
+    <div v-table-scroll-sync class="table-container">
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="columns"
+        :datasource="form.datasource"
+        class="time-form"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+        height="350"
+        full-height="calc(100vh - 76px)"
+        :show-summary="true"
+        :summary-method="getSummaries"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <div class="headbox">
+            <el-button
+              v-if="isShowAdd && needProduce != 4"
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="handlAdd"
+            >
+              新增
+            </el-button>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="handParent()"
+              v-if="isShowAdd && needProduce == 4"
+            >
+              新增
+            </el-button>
+          </div>
+        </template>
+        <template v-slot:technicalDrawings="{ row, $index }">
+          <el-form-item :prop="'datasource.' + $index + '.technicalDrawings'">
+            <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
+          </el-form-item>
+        </template>
+        <template v-slot:remark="{ row, $index }">
+          <el-form-item :prop="'datasource.' + $index + '.remark'">
+            <el-input
+              clearable
+              v-model="row.remark"
+              type="textarea"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </template>
+
+        <template v-slot:packagingStrength="scope">
+          <el-form-item>
+            <DictSelection
+              dict-name="包装强度"
+              @change="keyChange(scope.$index, scope.row, 'packagingStrength')"
+              v-model="scope.row.extField.packagingStrength"
+              :isOne="scope.$index === 0"
+            ></DictSelection>
+          </el-form-item>
+        </template>
+        <template v-slot:packagingDensity="scope">
+          <el-form-item>
+            <DictSelection
+              dict-name="包装密度"
+              @change="keyChange(scope.$index, scope.row, 'packagingDensity')"
+              v-model="scope.row.extField.packagingDensity"
+              :isOne="scope.$index === 0"
+            ></DictSelection>
+          </el-form-item>
+        </template>
+
+        <template v-slot:batchStockId="scope">
+          <el-form-item :prop="'datasource.' + scope.$index + '.batchStockId'">
+            <!-- <el-input v-model="scope.row.batchNo"></el-input> -->
+            <el-select
+              v-model="scope.row.batchStockId"
+              clearable
+              placeholder="请选择"
+              @change="batchNoChange(scope.$index, scope.row)"
+            >
+              <el-option
+                v-for="item in scope.row.batchNoList || []"
+                :key="item.id"
+                :label="item.batchNo"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+        <!-- 生产编号 可编辑 -->
+        <template v-slot:productionCodes="{ row }">
+          <el-form-item>
+            <el-input v-model="row.productionCodes"></el-input>
+          </el-form-item>
+        </template>
+        <template v-slot:blockCount="scope">
+          <el-form-item
+            :prop="'datasource.' + scope.$index + '.blockCount'"
+            :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
           >
-            新增
-          </el-button>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="handParent()"
-            v-if="isShowAdd && needProduce == 4"
+            <el-input
+              v-model="scope.row.blockCount"
+              @input="
+                (val) => tableHandleKeyUp(scope.row, scope.$index, 'blockCount')
+              "
+            ></el-input>
+          </el-form-item>
+        </template>
+
+        <template v-slot:receiveTotalWeight="scope">
+          <el-form-item
+            :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
           >
-            新增
-          </el-button>
-        </div>
-      </template>
-      <template v-slot:technicalDrawings="{ row, $index }">
-        <el-form-item :prop="'datasource.' + $index + '.technicalDrawings'">
-          <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
-        </el-form-item>
-      </template>
-      <template v-slot:remark="{ row, $index }">
-        <el-form-item :prop="'datasource.' + $index + '.remark'">
-          <el-input
-            clearable
-            v-model="row.remark"
-            type="textarea"
-            placeholder="请输入"
-          />
-        </el-form-item>
-      </template>
-
-      <template v-slot:packagingStrength="scope">
-        <el-form-item>
-          <DictSelection
-            dict-name="包装强度"
-            @change="keyChange(scope.$index, scope.row, 'packagingStrength')"
-            v-model="scope.row.extField.packagingStrength"
-            :isOne="scope.$index === 0"
-          ></DictSelection>
-        </el-form-item>
-      </template>
-      <template v-slot:packagingDensity="scope">
-        <el-form-item>
-          <DictSelection
-            dict-name="包装密度"
-            @change="keyChange(scope.$index, scope.row, 'packagingDensity')"
-            v-model="scope.row.extField.packagingDensity"
-            :isOne="scope.$index === 0"
-          ></DictSelection>
-        </el-form-item>
-      </template>
-
-      <template v-slot:batchStockId="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.batchStockId'">
-          <!-- <el-input v-model="scope.row.batchNo"></el-input> -->
-          <el-select
-            v-model="scope.row.batchStockId"
-            clearable
-            placeholder="请选择"
-            @change="batchNoChange(scope.$index, scope.row)"
-          >
-            <el-option
-              v-for="item in scope.row.batchNoList || []"
-              :key="item.id"
-              :label="item.batchNo"
-              :value="item.id"
+            <el-input
+              type="number"
+              v-model="scope.row.receiveTotalWeight"
+              @input="changeSendTotalWeight(scope.row, scope.$index)"
+              style="width: calc(100% - 70px); margin-right: 10px"
             >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </template>
-      <!-- 生产编号 可编辑 -->
-      <template v-slot:productionCodes="{ row }">
-        <el-form-item>
-          <el-input v-model="row.productionCodes"></el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:blockCount="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.blockCount'"
-          :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
-        >
-          <el-input
-            v-model="scope.row.blockCount"
-            @input="
-              (val) => tableHandleKeyUp(scope.row, scope.$index, 'blockCount')
-            "
-          ></el-input>
-        </el-form-item>
-      </template>
-
-      <template v-slot:receiveTotalWeight="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
-        >
-          <el-input
-            type="number"
-            v-model="scope.row.receiveTotalWeight"
-            @input="changeSendTotalWeight(scope.row, scope.$index)"
-            style="width: calc(100% - 70px); margin-right: 10px"
-          >
-            <template slot="append">
-              {{ scope.row.weightUnit }}
-            </template>
-          </el-input>
-          <el-button
-            size="small"
-            type="primary"
-            v-if="entrustedCode"
-            @click.native="(e) => handleInnerBound(e, scope.row, scope.$index)"
-            >选择
-          </el-button>
-        </el-form-item>
-      </template>
-      <template v-slot:orderNo="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.orderNo'"
-          :rules="[
-            {
-              required: false,
-              message: '请选择订单编号',
-              trigger: 'blur'
-            }
-          ]"
-        >
-          <el-select
-           v-if="needProduce == 4 && orderNoList.length > 1"
-            v-model="scope.row.orderNo"
-            placeholder="请选择"
+              <template slot="append">
+                {{ scope.row.weightUnit }}
+              </template>
+            </el-input>
+            <el-button
+              size="small"
+              type="primary"
+              v-if="entrustedCode"
+              @click.native="
+                (e) => handleInnerBound(e, scope.row, scope.$index)
+              "
+              >选择
+            </el-button>
+          </el-form-item>
+        </template>
+        <template v-slot:orderNo="scope">
+          <el-form-item
+            :prop="'datasource.' + scope.$index + '.orderNo'"
+            :rules="[
+              {
+                required: false,
+                message: '请选择订单编号',
+                trigger: 'blur'
+              }
+            ]"
           >
-            <el-option
-              v-for="item in orderNoList"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
+            <el-select
+              v-if="needProduce == 4 && orderNoList.length > 1"
+              v-model="scope.row.orderNo"
+              placeholder="请选择"
             >
-            </el-option>
-          </el-select>
-          <span v-else>{{ scope.row.orderNo }}</span>
-        </el-form-item>
-      </template>
-      <template v-slot:sendTotalWeight="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.sendTotalWeight'">
-          <el-input
-            type="number"
-            v-model="scope.row.sendTotalWeight"
-            style="width: 100%"
-            @input="changeCount(scope.row, scope.$index, true, 'totalWeight')"
+              <el-option
+                v-for="item in orderNoList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <span v-else>{{ scope.row.orderNo }}</span>
+          </el-form-item>
+        </template>
+        <template v-slot:sendTotalWeight="scope">
+          <el-form-item
+            :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
           >
-            <template slot="append">
-              {{ scope.row.weightUnit }}
-            </template>
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:increaseTotalWeight="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.increaseTotalWeight'"
-        >
-          <el-input
-            type="number"
-            v-model="scope.row.increaseTotalWeight"
-            style="width: 100%"
-            disabled
+            <el-input
+              type="number"
+              v-model="scope.row.sendTotalWeight"
+              style="width: 100%"
+              @input="changeCount(scope.row, scope.$index, true, 'totalWeight')"
+            >
+              <template slot="append">
+                {{ scope.row.weightUnit }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </template>
+        <template v-slot:increaseTotalWeight="scope">
+          <el-form-item
+            :prop="'datasource.' + scope.$index + '.increaseTotalWeight'"
           >
-            <template slot="append">
-              {{ scope.row.weightUnit }}
-            </template>
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:warehouseId="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.warehouseId'"
-          :rules="[
-            {
-              required: isWarehouseId == 1 ? true : false,
-              message: '请选择仓库',
-              trigger: 'blur'
-            }
-          ]"
-        >
-          <el-select
-            v-model="scope.row.warehouseId"
-            placeholder="请选择"
-            @change="warehouseChange(scope.$index, scope.row, true)"
+            <el-input
+              type="number"
+              v-model="scope.row.increaseTotalWeight"
+              style="width: 100%"
+              disabled
+            >
+              <template slot="append">
+                {{ scope.row.weightUnit }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </template>
+        <template v-slot:warehouseId="scope">
+          <el-form-item
+            :prop="'datasource.' + scope.$index + '.warehouseId'"
+            :rules="[
+              {
+                required: isWarehouseId == 1 ? true : false,
+                message: '请选择仓库',
+                trigger: 'blur'
+              }
+            ]"
           >
-            <el-option
-              v-for="item in scope.row.warehouseList"
-              :key="item.warehouseId"
-              :label="item.warehouseName"
-              :value="item.warehouseId"
+            <el-select
+              v-model="scope.row.warehouseId"
+              placeholder="请选择"
+              @change="warehouseChange(scope.$index, scope.row, true)"
             >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </template>
-
-      <template v-slot:singlePrice="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.singlePrice'"
-          :rules="{
-            required: true,
-            message: '请输入正确的单价',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="scope.row.singlePrice"
-            placeholder="请输入"
-            @input="changeCount(scope.row, scope.$index)"
-            type="number"
+              <el-option
+                v-for="item in scope.row.warehouseList"
+                :key="item.warehouseId"
+                :label="item.warehouseName"
+                :value="item.warehouseId"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+
+        <template v-slot:singlePrice="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'datasource.' + scope.$index + '.singlePrice'"
+            :rules="{
+              required: true,
+              message: '请输入正确的单价',
+              trigger: 'change'
+            }"
           >
-            <template slot="append">元</template>
-          </el-input>
-        </el-form-item>
-      </template>
-
-      <template v-slot:singleWeight="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :rules="{
-            required: false,
+            <el-input
+              v-model="scope.row.singlePrice"
+              placeholder="请输入"
+              @input="changeCount(scope.row, scope.$index)"
+              type="number"
+            >
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </template>
+
+        <template v-slot:singleWeight="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :rules="{
+              required: false,
 
-            trigger: 'change'
-          }"
-          :prop="'datasource.' + scope.$index + '.singleWeight'"
-        >
-          <el-input
-            v-model="scope.row.singleWeight"
-            type="number"
-            placeholder="请输入"
-            :disabled="needProduce == 4"
-            @input="changeCount(scope.row, scope.$index)"
+              trigger: 'change'
+            }"
+            :prop="'datasource.' + scope.$index + '.singleWeight'"
           >
-            <template slot="append">
-              {{ scope.row.weightUnit }}
-            </template>
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:headerWarehouseNum="{ column }">
-        <span class="is-required">{{ column.label }}</span>
-      </template>
-      <template v-slot:headerWarehouseId="{ column }">
-        <span :class="isWarehouseId == 1 ? 'is-required' : ''">{{
-          column.label
-        }}</span>
-      </template>
-      <template v-slot:headerTotalCount="{ column }">
-        <span class="is-required">{{ column.label }}</span>
-      </template>
-
-      <template v-slot:headerReceiveTotalWeight="{ column }">
-        <span :class="{ 'is-required': entrustedCode && pricingWay == 2 }">{{
-          column.label
-        }}</span>
-      </template>
-      <template v-slot:saleCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.saleCount'"
-          :rules="[{
-            required: true,
-            message: '请输入数量',
-            trigger: 'change'
-          },{
-              validator: (rule, value, callback) => {
-                if (value === undefined || value === null || value === '') {
-                  callback('请输入数量');
-                } else if (parseFloat(value) <= 0) {
-                  callback('数量必须大于0');
-                } else {
-                  callback();
-                }
+            <el-input
+              v-model="scope.row.singleWeight"
+              type="number"
+              placeholder="请输入"
+              :disabled="needProduce == 4"
+              @input="changeCount(scope.row, scope.$index)"
+            >
+              <template slot="append">
+                {{ scope.row.weightUnit }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </template>
+        <template v-slot:headerWarehouseNum="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
+        <template v-slot:headerWarehouseId="{ column }">
+          <span :class="isWarehouseId == 1 ? 'is-required' : ''">{{
+            column.label
+          }}</span>
+        </template>
+        <template v-slot:headerTotalCount="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
+
+        <template v-slot:headerReceiveTotalWeight="{ column }">
+          <span :class="{ 'is-required': entrustedCode && pricingWay == 2 }">{{
+            column.label
+          }}</span>
+        </template>
+        <template v-slot:saleCount="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'datasource.' + scope.$index + '.saleCount'"
+            :rules="[
+              {
+                required: true,
+                message: '请输入数量',
+                trigger: 'change'
               },
-              trigger: 'blur'
-            }]"
-        >
-          <el-input
-            v-model="scope.row.saleCount"
-            placeholder="请输入"
-            type="number"
-            :min="0"
-            :disabled="sourceType == 4"
-            @input="changeCount(scope.row, scope.$index, false)"
-          >
-            <template slot="append">
-              <el-select
-                v-model="scope.row.saleUnitId"
-                style="width: 80px"
-                @change="changeCount(scope.row, scope.$index)"
-                :disabled="clientEnvironmentId == 4 || sourceType == 4"
-              >
-                <el-option
-                  :label="item.conversionUnit"
-                  :value="item.id"
-                  v-for="(item, index) in scope.row.packageDispositionList"
-                  :key="index"
-                ></el-option>
-              </el-select>
-            </template>
-          </el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:warehouseNum="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.warehouseNum'">
-          <span>{{ scope.row.warehouseNum }}</span>
-        </el-form-item>
-      </template>
-      <template v-slot:cuttingLength="{ row, $index }">
-        <el-form-item
-          :prop="'datasource.' + $index + '.cuttingLength'"
-        >
-          <el-input
-            v-model="row.cuttingLength"
-            placeholder="请输入"
+              {
+                validator: (rule, value, callback) => {
+                  if (value === undefined || value === null || value === '') {
+                    callback('请输入数量');
+                  } else if (parseFloat(value) <= 0) {
+                    callback('数量必须大于0');
+                  } else {
+                    callback();
+                  }
+                },
+                trigger: 'blur'
+              }
+            ]"
           >
-          </el-input>
-        </el-form-item>
-      </template>
-      <!-- <template v-slot:saleUnit="scope">
+            <el-input
+              v-model="scope.row.saleCount"
+              placeholder="请输入"
+              type="number"
+              :min="0"
+              :disabled="sourceType == 4"
+              @input="changeCount(scope.row, scope.$index, false)"
+            >
+              <template slot="append">
+                <el-select
+                  v-model="scope.row.saleUnitId"
+                  style="width: 80px"
+                  @change="changeCount(scope.row, scope.$index)"
+                  :disabled="clientEnvironmentId == 4 || sourceType == 4"
+                >
+                  <el-option
+                    :label="item.conversionUnit"
+                    :value="item.id"
+                    v-for="(item, index) in scope.row.packageDispositionList"
+                    :key="index"
+                  ></el-option>
+                </el-select>
+              </template>
+            </el-input>
+          </el-form-item>
+        </template>
+        <template v-slot:warehouseNum="scope">
+          <el-form-item :prop="'datasource.' + scope.$index + '.warehouseNum'">
+            <span>{{ scope.row.warehouseNum }}</span>
+          </el-form-item>
+        </template>
+        <template v-slot:cuttingLength="{ row, $index }">
+          <el-form-item :prop="'datasource.' + $index + '.cuttingLength'">
+            <el-input v-model="row.cuttingLength" placeholder="请输入">
+            </el-input>
+          </el-form-item>
+        </template>
+        <!-- <template v-slot:saleUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.saleUnitId'"
@@ -366,60 +369,62 @@
           </el-select>
         </el-form-item>
       </template> -->
-      <template v-slot:modelKey="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
-          <DictSelection
-            dictName="物品机型"
-            clearable
-            v-model="scope.row.modelKey"
-            :isOne="scope.$index === 0"
-            filterable
-            allow-create
-            default-first-option
-            multiple
+        <template v-slot:modelKey="scope">
+          <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
+            <DictSelection
+              dictName="物品机型"
+              clearable
+              v-model="scope.row.modelKey"
+              :isOne="scope.$index === 0"
+              filterable
+              allow-create
+              default-first-option
+              multiple
+            >
+            </DictSelection>
+          </el-form-item>
+        </template>
+
+        <template v-slot:colorKey="scope">
+          <el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
+            <DictSelection
+              dictName="物品颜色"
+              clearable
+              v-model="scope.row.colorKey"
+              :isOne="scope.$index === 0"
+              filterable
+              allow-create
+              default-first-option
+              multiple
+            >
+            </DictSelection>
+          </el-form-item>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="scope">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(scope.$index)"
           >
-          </DictSelection>
-        </el-form-item>
-      </template>
-
-      <template v-slot:colorKey="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
-          <DictSelection
-            dictName="物品颜色"
-            clearable
-            v-model="scope.row.colorKey"
-            :isOne="scope.$index === 0"
-            filterable
-            allow-create
-            default-first-option
-            multiple
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="selectStockLedgerDialogOpen(scope.row)"
           >
-          </DictSelection>
-        </el-form-item>
-      </template>
-      <!-- 操作列 -->
-      <template v-slot:action="scope">
-        <el-popconfirm
-          class="ele-action"
-          title="确定要删除吗?"
-          @confirm="remove(scope.$index)"
-        >
-          <template v-slot:reference>
-            <el-link type="danger" :underline="false" icon="el-icon-delete">
-              删除
-            </el-link>
-          </template>
-        </el-popconfirm>
-        <el-link
-          type="primary"
-          :underline="false"
-          icon="el-icon-edit"
-          @click="selectStockLedgerDialogOpen(scope.row)"
-        >
-          替代料
-        </el-link>
-      </template>
-    </ele-pro-table>
+            替代料
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </div>
+
     <productListNew
       ref="productListRef"
       @changeParent="changeParent"
@@ -600,12 +605,12 @@
         return this.$store.state.user.info.clientEnvironmentId;
       },
       orderNoList() {
-        const temp = this.orderNos?.split(',') || []
-        return temp.map(item => {
+        const temp = this.orderNos?.split(',') || [];
+        return temp.map((item) => {
           return {
             label: item,
             value: item
-          }
+          };
         });
       },
       columns() {
@@ -773,7 +778,7 @@
             align: 'center',
             formatter: (row, column) => {
               // if (row.notSendTotalCount) {
-                return row.notSendTotalCount
+              return row.notSendTotalCount;
               // }
             }
           },
@@ -784,7 +789,7 @@
             align: 'center',
             formatter: (row, column) => {
               // if (row.notGenerateSendCount) {
-                return row.notGenerateSendCount
+              return row.notGenerateSendCount;
               // }
             }
           },
@@ -794,7 +799,7 @@
             label: '计量数量',
             formatter: (row, column) => {
               // if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+              return row.totalCount + ' ' + row.measuringUnit;
               // }
             },
             align: 'center'
@@ -825,7 +830,8 @@
           //   slot: 'measuringUnit',
           //   align: 'center'
           // },
-          this.clientEnvironmentId == 4 ? {
+          this.clientEnvironmentId == 4
+            ? {
                 width: 150,
                 prop: 'blockCount',
                 label: '发货块数',
@@ -1033,9 +1039,7 @@
     methods: {
       formatPrice,
       getSummaries(param) {
-        if (this.clientEnvironmentId != 4) {
-          return;
-        }
+  
 
         return getSummaries(
           param,
@@ -1348,7 +1352,7 @@
           row['tempId'] = this.form.datasource.length + 1;
 
           let parasm = idx == -1 ? row : this.form.datasource[i];
-          console.log('parasm~~~~222', parasm);  
+          console.log('parasm~~~~222', parasm);
           this.$set(parasm, 'productId', item.id);
           this.$set(parasm, 'categoryName', item.name);
           this.$set(parasm, 'productCategoryId', item.categoryLevelId);
@@ -1403,16 +1407,12 @@
           );
 
           const templist = await getBatchList({
-                categoryCode: item.code,
-                warehouseId: item.warehouseId,
-                size: -1
-              });
+            categoryCode: item.code,
+            warehouseId: item.warehouseId,
+            size: -1
+          });
 
-          this.$set(
-            parasm,
-            'batchNoList',
-            templist?.list
-          );
+          this.$set(parasm, 'batchNoList', templist?.list);
 
           console.log('parasm~~~~333', parasm);
 
@@ -1714,9 +1714,15 @@
             (item) => Number(item.totalCount) > item.notGenerateSendCount
           );
           // 退货单退货不校验数量,实物赔偿无法计算
-          if (exceededItems.length > 0 && this.sourceType != 3 && this.needProduce != 4) {
+          if (
+            exceededItems.length > 0 &&
+            this.sourceType != 3 &&
+            this.needProduce != 4
+          ) {
             // 提取产品名称,生成详细提示消息
-            const productNames = exceededItems.map(item => item.productCode).join('、');
+            const productNames = exceededItems
+              .map((item) => item.productCode)
+              .join('、');
             this.$message.warning(`${productNames} 的发货数量大于订单剩余数量`);
             if (this.isTotalCount == 1) {
               callback(false);