Przeglądaj źródła

字段名称修改
销售发货新增发货明细

Z 2 lat temu
rodzic
commit
838ce19183

+ 10 - 1
src/api/bpm/components/saleManage/entrustedReceive.js

@@ -55,7 +55,16 @@ export async function deleteSaleEntrustedReceiveAPI(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
+/**
+ * 获取受托物料的已收货数量
+ */
+export async function getReceiveCountAPI(data) {
+  const res = await request.post('/eom/saleentrustedreceive/getReceiveCount', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 /**
  * 提交

+ 144 - 0
src/api/bpm/components/wms/index.js

@@ -0,0 +1,144 @@
+import request from '@/utils/request';
+
+/**
+ * 获取产品所有库存
+ */
+export async function getInventoryTotalAPI(data) {
+  const res = await request.post(`wms/stock/getInventoryTotal`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function getSubPage(data) {
+  const res = await request.get('/main/categoryLevel/getSubPage', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function saveOrUpdate(data) {
+  const res = await request.post('/main/categoryLevel/saveOrUpdate', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据父级id查分类树
+export async function getTreeByPid(parentId) {
+  const res = await request.get(`/main/categoryLevel/getTreeByPid/${parentId}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 查询所有物品分类
+export async function allCategoryLevel() {
+  const res = await request.get(`/main/categoryLevel/allCategoryLevel`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据type查分类树组
+export async function getTreeByGroup(data) {
+  const res = await request.get(`/main/categoryLevel/getProduceTreeByPid`, {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据类型查分类树
+export async function getTreeByType(type) {
+  const res = await request.get(`/main/categoryLevel/getTreeByType/${type}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 删除分类
+export async function deleteCategory(id) {
+  const res = await request.get(`/main/categoryLevel/delete/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//根据ID查询分类详情系信息
+export async function getInfoById(id) {
+  const res = await request.get(`/main/categoryLevel/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 批次明细
+
+export async function getBatchDetails(data) {
+  const res = await request.get(`/wms/outin/getBatchDetails`, { params: data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function getDetailById(data) {
+  const res = await request.post(`/wms/outin/getDetailById`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 产品列表
+ */
+export async function getProductList(params) {
+  const res = await request.get(`/main/category/getList`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+//库存台账-库存明细-物料维度
+
+export async function getMaterielDetails(params) {
+  const res = await request.get(`/wms/outin/getMaterielDetails`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//库存台账-库存明细
+
+export async function getInventoryDetails (params)  {
+  const res = await request.get(`/wms/outin/getInventoryDetails`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 查询仓库下拉列表
+export async function getWarehouseList() {
+  const res = await request.post(`/wms/warehouse/getWarehouseList`, {});
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 1
src/views/bpm/handleTask/components/contractBook/detailDialog.vue

@@ -58,7 +58,7 @@
             {{ form.contractNo }}
           </el-form-item>
           <el-form-item
-            label="编号:"
+            label="合同编号:"
             prop="contractNumber"
             style="margin-bottom: 16px"
           >

+ 6 - 6
src/views/bpm/handleTask/components/contractBook/searchContract.vue

@@ -19,7 +19,7 @@
           <DictSelection dictName="合同类型" clearable v-model="params.type">
                 </DictSelection>
         </el-form-item>
-       
+
       </el-col>
       <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
         <el-form-item label="编码:" prop="contractNo">
@@ -27,21 +27,21 @@
           placeholder="请输入"
            v-model.trim="params.contractNo" controls-position="right" ></el-input>
         </el-form-item>
-        <el-form-item label="编号:" prop="contractNumber">
+        <el-form-item label="合同编号:" prop="contractNumber">
           <el-input
           placeholder="请输入"
            v-model.trim="params.contractNumber" controls-position="right" ></el-input>
         </el-form-item>
-      </el-col> 
+      </el-col>
       <el-col v-bind="styleResponsive ? { lg:8, md: 12 } : { span:6 }">
-       
+
         <el-form-item label="客户名称:" prop="contactName">
           <el-input
           placeholder="请输入"
           style="max-width:180px"
            v-model.trim="params.contactName" controls-position="right" >
           </el-input>
-         
+
         </el-form-item>
         <el-form-item label="签订人:" prop="linkName">
           <el-input
@@ -50,7 +50,7 @@
            v-model.trim="params.linkName" controls-position="right" >
           </el-input>
         </el-form-item>
-      </el-col> 
+      </el-col>
 
       <el-col v-bind="styleResponsive ? { lg:4, md: 12 } : { span:4 }">
         <div class="ele-form-actions">

+ 1 - 1
src/views/bpm/handleTask/components/purchaseNeedManage/addDialog.vue

@@ -5,7 +5,7 @@
       <el-row>
         <el-col :span="12">
           <el-form-item
-            label="订单类型"
+            label="需求类型"
             prop="sourceType"
             style="margin-bottom: 22px"
           >

+ 1 - 1
src/views/bpm/handleTask/components/purchaseNeedManage/detailDialog.vue

@@ -14,7 +14,7 @@
       </headerTitle>
       <el-row>
         <el-col :span="12">
-          <el-form-item label="订单类型:" prop="sourceTypeName">
+          <el-form-item label="需求类型:" prop="sourceTypeName">
             {{ form.sourceTypeName }}
           </el-form-item>
         </el-col>

+ 2 - 2
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/detailDialog.vue

@@ -89,9 +89,9 @@
        </el-col>
        <el-col :span="12">
          <el-form-item prop="files" label="附件:">
-           <div v-if="row.files && row.files?.length">
+           <div v-if="form.files && form.files?.length">
              <el-link
-               v-for="link in row.files"
+               v-for="link in form.files"
                :key="link.id"
                type="primary"
                :underline="false"

+ 1 - 1
src/views/bpm/handleTask/components/purchasePlanManage/detailDialog.vue

@@ -37,7 +37,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="订单类型:" prop="sourceTypeName">
+          <el-form-item label="需求类型:" prop="sourceTypeName">
             {{ form.sourceTypeName }}
           </el-form-item>
         </el-col>

+ 18 - 6
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/addOrEditDialog.vue

@@ -113,10 +113,9 @@
 import fileUpload from '@/components/upload/fileUpload';
 import dictMixins from '@/mixins/dictMixins';
 import {
-  saveSaleEntrustedReceiveAPI,
   updateSaleEntrustedReceiveAPI,
   getPSaleEntrustedReceiveDetailAPI,
-  submit
+  getReceiveCountAPI
 } from '@/api/bpm/components/saleManage/entrustedReceive';
 // import {getcontactlink} from '@/api/saleManage/businessFollow';
 import inventoryTable from './inventoryTable.vue';
@@ -217,7 +216,7 @@ export default {
       const data = await getpurchaseorderDetail(id);
       this.loading = false;
       if (data) {
-        this.$nextTick(() => {
+        this.$nextTick(async () => {
           let {
             partaId,
             partaName,
@@ -243,12 +242,24 @@ export default {
             productList,
             pricingWay
           });
-          this.$refs.inventoryTableref &&
-          this.$refs.inventoryTableref.putTableValue(productList);
+
+          this.form = await this.getTotalCountHistory(this.form);
+          await this.$refs.inventoryTableref &&
+          this.$refs.inventoryTableref.putTableValue(this.form.productList);
         });
       }
     },
-
+    //获取产品已发货数总量
+    async getTotalCountHistory(data) {
+      let list = await getReceiveCountAPI({orderId: data.orderId, entrustedReceiveId: this.form.id});
+      data.productList.forEach((item) => {
+        let find = list.find((key) => key.productCode == item.productCode) || {};
+        item.receiveTotalCount = find.receiveTotalCount || 0;
+        item.orderTotalCount = item.totalCount || 0
+        item.totalCount = item.orderTotalCount - item.receiveTotalCount
+      });
+      return data
+    },
     //发货单详情
     async getSendSaleOrderDetail(id) {
       this.businessId = id;
@@ -259,6 +270,7 @@ export default {
       if (data) {
         this.$nextTick(() => {
           this.form = data;
+          this.form.pricingWay = data?.saleOrder?.pricingWay
           this.$refs.inventoryTableref &&
           this.$refs.inventoryTableref.putTableValue(data.productList);
         });

+ 16 - 1
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/detailDialog.vue

@@ -198,11 +198,26 @@ export default {
           align: "center"
         },
 
+        {
+          width: 110,
+          prop: 'orderTotalCount',
+          label: '订单总数量',
+          slot: 'orderTotalCount',
+          align: "center"
+        },
         {
           width: 120,
           prop: 'totalCount',
-          label: '数量',
+          label: '本次收货数量',
           slot: 'totalCount',
+          headerSlot: 'headerTotalCount',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'receiveTotalCount',
+          label: '已收货总数',
+          slot: 'receiveTotalCount',
           align: "center"
         },
         {

+ 20 - 9
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/inventoryTable.vue

@@ -305,19 +305,27 @@ export default {
           align: "center"
         },
         {
-          width: 100,
+          width: 110,
+          prop: 'orderTotalCount',
+          label: '订单总数量',
+          slot: 'orderTotalCount',
+          align: "center"
+        },
+        {
+          width: 120,
           prop: 'totalCount',
-          label: '数量',
+          label: '本次收货数量',
           slot: 'totalCount',
           headerSlot: 'headerTotalCount',
           align: "center"
         },
-        // {
-        //   width: 120,
-        //   prop: 'orderTotalCount',
-        //   label: '总数量',
-        //   slot: 'orderTotalCount'
-        // },
+        {
+          width: 100,
+          prop: 'receiveTotalCount',
+          label: '已收货总数',
+          slot: 'receiveTotalCount',
+          align: "center"
+        },
         {
           minWidth: 100,
           prop: 'measuringUnit',
@@ -530,9 +538,11 @@ export default {
       this.$set(this.form.datasource[index], 'receiveTotalWeight', val ? val * row.singleWeight : '');
       this.$set(this.form.datasource[index], 'totalPrice', this.getTotalPrice(row).toFixed(2));
       this.$set(this.form.datasource[index], 'discountTotalPrice', this.getDiscountTotalPrice(row).toFixed(2));
+      this.$refs.table.reload()
     },
     getTotalPrice(row) {
       let num = 0
+      console.log(this.pricingWay);
       switch (this.pricingWay) {
         case 1: //按数量计价计算总金额
           num = Number(row.singlePrice) * Number(row.totalCount)
@@ -612,7 +622,8 @@ export default {
               })
             );
           }
-          if(!item.receiveTotalWeight)this.$set(item, 'receiveTotalWeight', Number(item.totalCount) * Number(item.singleWeight) );
+          //发货数量因已发货数量被修改需要重新计算金额,总重
+          this.changeNum(item.totalCount,item,index)
         });
       }
     },

+ 53 - 1
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -146,6 +146,24 @@
         <span class="amount">应付金额:{{detailData.payAmount}}元</span>
       </div>
       </template> -->
+        <template v-slot:stockLedger="scope">
+          <el-popover
+            placement="right"
+            width="60%"
+            trigger="hover">
+            <ele-pro-table :ref="'childrenTable'+scope.$index"
+                           row-key="id"
+                           max-height="300px"
+                           :needPage="false"
+                           :columns="childrenColumns"
+                           :toolkit="[]"
+                           :datasource="scope.row.sendProductDetail"
+                           cache-key="stockLedgerRoleTable" class="time-form">
+            </ele-pro-table>
+            <el-button type="text" slot="reference">明细</el-button>
+
+          </el-popover>
+        </template>
         <template v-slot:industryArtFiles="{ row, $index }">
           <el-form-item
             style="margin-bottom: 20px"
@@ -195,6 +213,7 @@
             >
           </div>
         </template>
+
       </ele-pro-table>
     </div>
 
@@ -235,6 +254,33 @@
         },
         rules: {},
         detailData: {},
+        childrenColumns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left',
+          },
+          {
+            minWidth: 100,
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+          },
+          {
+            minWidth: 140,
+            prop: 'barcodes',
+            label: '发货条码',
+            align: 'center',
+          },
+          {
+            minWidth: 100,
+            prop: 'engrave',
+            label: '刻码',
+            align: 'center',
+          }
+        ],
         competAnalysisListcolumns: [
           {
             width: 45,
@@ -299,7 +345,13 @@
             slot: 'warehouseName',
             align: 'center',
           },
-
+          {
+            width: 100,
+            prop: 'stockLedger',
+            label: '发货明细',
+            slot: 'stockLedger',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'totalCount',

+ 244 - 83
src/views/bpm/handleTask/components/saleOrder/invoice/inventoryTable.vue

@@ -137,6 +137,47 @@
       <template v-slot:headerWarehouseId="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
+      <template v-slot:stockLedger="scope">
+        <el-form-item
+          style="margin-bottom: 20px">
+          <el-popover
+            @hide="()=>selection=[]"
+            placement="right"
+            width="60%"
+            trigger="hover">
+            <ele-pro-table :ref="'childrenTable'+scope.$index"
+                           row-key="id"
+                           max-height="300px"
+                           :selection.sync="selection"
+                           :needPage="false" :columns="childrenColumns" :toolkit="[]"
+                           :datasource="scope.row.sendProductDetail"
+                           cache-key="stockLedgerRoleTable" class="time-form">
+              <!-- 表头工具栏 -->
+              <template v-slot:toolbar="childrenScope">
+                <el-button
+                  size="small"
+                  type="primary"
+                  icon="el-icon-plus"
+                  class="ele-btn-icon"
+                  @click="stockLedgerSelect(scope.row,scope.$index)">
+                  选择
+                </el-button>
+                <el-button
+                  size="small"
+                  type="danger"
+                  icon="el-icon-delete"
+                  class="ele-btn-icon"
+                  :disabled="!selection.length"
+                  @click="stockLedgerRemove(scope.$index)">
+                  删除
+                </el-button>
+              </template>
+            </ele-pro-table>
+            <el-button type="text" slot="reference">明细</el-button>
+
+          </el-popover>
+        </el-form-item>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="scope">
         <el-popconfirm
@@ -157,6 +198,9 @@
       :orderId="orderId"
       @changeParent="changeParent"
     ></product-list>
+    <!-- 库存台账   -->
+    <stock-ledger-dialog v-if="stockLedgerDialogFlag" :stock-ledger-dialog-flag.sync="stockLedgerDialogFlag"
+                         ref="stockLedgerDialogRef" @getStockLedger="getStockLedger"></stock-ledger-dialog>
   </el-form>
 </template>
 <script>
@@ -169,12 +213,14 @@
   } from '@/api/bpm/components/saleManage/saleorder';
 
   import { copyObj } from '@/utils/util';
+  import StockLedgerDialog from "@/views/bpm/handleTask/components/saleOrder/invoice/stockLedger/stockLedgerDialog.vue";
   export default {
     mixins: [dictMixins],
     props: {
       orderId: String
     },
     components: {
+      StockLedgerDialog,
       productList
     },
     data() {
@@ -191,8 +237,44 @@
         // warehouseName:'',
       };
       return {
+        childrenColumns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left',
+          },
+          {
+            minWidth: 100,
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+          },
+          {
+            minWidth: 140,
+            prop: 'barcodes',
+            label: '发货条码',
+            align: 'center',
+          },
+          {
+            minWidth: 100,
+            prop: 'engrave',
+            label: '刻码',
+            align: 'center',
+          }
+        ],
+        selection: [],
+        stockLedgerDialogFlag: false,
         discountTotalPrice: 0.0,
         allPrice: 0.0,
+        curIndex: null,
         numberReg,
         defaultForm,
         warehouseList: [],
@@ -201,184 +283,247 @@
           datasource: []
         },
         rules: {},
-
-        columns: [
+      };
+    },
+    created() {
+      getWarehouseList().then((res) => {
+        this.warehouseList = res;
+      });
+    },
+    computed: {
+      canHandl() {
+        return this.form.datasource.length;
+      },
+      contractId() {
+        return this.$store.state.order.contractId;
+      },
+      columns() {
+        return [
           {
             width: 45,
             type: 'index',
             columnKey: 'index',
             align: 'center',
-            fixed: 'left'
+            fixed: 'left',
           },
           {
             width: 200,
             prop: 'productName',
             label: '名称',
-            slot: 'productName'
+            slot: 'productName',
+            align: 'center',
           },
           {
             width: 120,
             prop: 'productCode',
             label: '编码',
-            slot: 'productCode'
+            slot: 'productCode',
+            align: 'center'
           },
           {
             width: 200,
             prop: 'productCategoryName',
             label: '类型',
-            slot: 'productCategoryName'
+            slot: 'productCategoryName',
+            align: 'center'
           },
           {
             width: 160,
             prop: 'productBrand',
             label: '牌号',
-            slot: 'productBrand'
+            slot: 'productBrand',
+            align: 'center'
           },
           {
             width: 120,
             prop: 'modelType',
             label: '型号',
-            slot: 'modelType'
+            slot: 'modelType',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'customerMark',
+            label: '客户代号',
+            slot: 'customerMark',
+            align: 'center',
           },
           {
             width: 120,
             prop: 'specification',
             label: '规格',
-            slot: 'specification'
+            slot: 'specification',
+            align: 'center'
           },
           {
             width: 200,
             prop: 'warehouseId',
             label: '仓库名称',
             slot: 'warehouseId',
-            headerSlot: 'headerWarehouseId'
+            headerSlot: 'headerWarehouseId',
+            align: 'center'
           },
           {
             width: 100,
-            prop: 'warehouseNum',
-            label: '库存',
-            slot: 'warehouseNum'
+            prop: 'stockLedger',
+            label: '发货明细',
+            slot: 'stockLedger',
+            align: 'center'
           },
           {
             width: 120,
             prop: 'totalCount',
             label: '发货数量',
             slot: 'totalCount',
-            headerSlot: 'headerTotalCount'
+            headerSlot: 'headerTotalCount',
+            align: 'center'
           },
           {
             width: 120,
             prop: 'orderTotalCount',
-            label: '总数量',
-            slot: 'orderTotalCount'
+            label: '订单总数量',
+            slot: 'orderTotalCount',
+            align: 'center',
+            show: !!!this.entrustedCode
+          },
+          {
+            width: 120,
+            prop: 'orderTotalCount',
+            label: '委外收货总数量',
+            slot: 'orderTotalCount',
+            align: 'center',
+            show: !!this.entrustedCode
           },
           {
             width: 80,
             prop: 'measuringUnit',
             label: '计量单位',
-            slot: 'measuringUnit'
+            slot: 'measuringUnit',
+            align: 'center'
           },
           {
-            width: 160,
-            prop: 'singlePrice',
-            label: '单价',
-            slot: 'singlePrice'
+            width: 120,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: "center"
           },
           {
-            width: 160,
-            prop: 'discountSinglePrice',
-            label: '折让单价',
-            slot: 'discountSinglePrice'
+            width: 200,
+            prop: 'receiveTotalWeight',
+            label: '收货总重',
+            slot: 'receiveTotalWeight',
+            align: "center",
+            headerSlot: 'headerTotalCount'
           },
           {
-            width: 120,
-            prop: 'totalPrice',
-            label: '合计',
-            slot: 'totalPrice'
+            width: 100,
+            prop: 'sendTotalWeight',
+            label: '发货总重',
+            slot: 'sendTotalWeight',
+            align: "center",
+          },
+
+          {
+            width: 100,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            slot: 'increaseTotalWeight',
+            align: "center"
+          },
+          {
+            width: 100,
+            prop: 'weightUnit',
+            label: '重量单位',
+            slot: 'weightUnit',
+            align: "center"
           },
           {
             width: 160,
-            prop: 'discountTotalPrice',
-            label: '折让合计',
-            slot: 'discountTotalPrice'
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
           },
           {
-            width: 120,
-            prop: 'singleWeight',
-            label: '单重',
-            slot: 'singleWeight'
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice',
+            align: 'center'
           },
           {
             width: 120,
-            prop: 'totalWeight',
-            label: '总重',
-            slot: 'totalWeight'
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center'
           },
           {
             width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit'
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice',
+            align: 'center'
           },
           {
-            width: 160,
-            prop: 'customerExpectDeliveryDeadline',
-            label: '客户期望交期',
-            slot: 'customerExpectDeliveryDeadline',
-            headerSlot: 'headerCustomerExpectDeliveryDeadline'
+            width: 80,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays',
+            align: 'center'
           },
           {
             width: 160,
-            prop: 'produceDeliveryDeadline',
-            label: '生产交付交期',
-            slot: 'produceDeliveryDeadline'
+            prop: 'deliveryDeadline',
+            label: '交期截止日期',
+            slot: 'deliveryDeadline',
+            align: 'center'
           },
           {
             width: 200,
             prop: 'guaranteePeriod',
             label: '质保期',
-            slot: 'guaranteePeriod'
+            slot: 'guaranteePeriod',
+            formatter: (_row, _column, cellValue) => {
+              return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+            },
+            align: 'center'
           },
           {
             width: 160,
             prop: 'guaranteePeriodDeadline',
-            label: '质保截止日期'
+            label: '质保截止日期',
+            slot: 'guaranteePeriodDeadline',
+            align: 'center'
           },
           {
             width: 130,
             prop: 'technicalAnswerName',
             label: '技术答疑人',
-            slot: 'technicalAnswerName'
+            slot: 'technicalAnswerName',
+            align: 'center'
           },
           {
             width: 220,
             prop: 'technicalParams',
             label: '技术参数',
-            slot: 'technicalParams'
+            slot: 'technicalParams',
+            align: 'center'
           },
           {
             width: 240,
             prop: 'technicalDrawings',
             label: '技术图纸',
-            slot: 'technicalDrawings'
-          },
-          {
-            width: 240,
-            prop: 'industryArtFiles',
-            label: '工艺附件',
-            slot: 'industryArtFiles'
-          },
-          {
-            width: 240,
-            prop: 'otherFiles',
-            label: '其他附件',
-            slot: 'otherFiles'
+            slot: 'technicalDrawings',
+            align: 'center'
           },
           {
             width: 220,
             prop: 'remark',
             label: '备注',
-            slot: 'remark'
+            slot: 'remark',
+            align: 'center'
           },
           {
             columnKey: 'action',
@@ -391,22 +536,38 @@
             showOverflowTooltip: true
           }
         ]
-      };
-    },
-    created() {
-      getWarehouseList().then((res) => {
-        this.warehouseList = res;
-      });
-    },
-    computed: {
-      canHandl() {
-        return this.form.datasource.length;
-      },
-      contractId() {
-        return this.$store.state.order.contractId;
       }
     },
     methods: {
+      //发货明细选择
+      stockLedgerSelect(row, index) {
+        this.curIndex = index
+        this.stockLedgerDialogFlag = true
+        this.$nextTick(() => {
+          this.$refs.stockLedgerDialogRef.init(row.sendProductDetail,row)
+        })
+      },
+      //获取
+      getStockLedger(sendProductDetail) {
+        if (!this.form.datasource[this.curIndex].sendProductDetail) this.form.datasource[this.curIndex].sendProductDetail = []
+        let row = this.form.datasource[this.curIndex]
+        row.sendProductDetail.push(...sendProductDetail)
+        this.form.datasource[this.curIndex] = row
+        this.$refs['childrenTable'+this.curIndex].reload()
+        this.$refs.table.reload()
+      },
+      //删除发货明细
+      stockLedgerRemove(PIndex) {
+        let row = this.form.datasource[PIndex]
+        this.selection.forEach(item => {
+          let index = row.sendProductDetail.findIndex(i => i.id == item.id)
+          row.sendProductDetail.splice(index, 1)
+        })
+        this.form.datasource[PIndex] = row
+        this.$refs['childrenTable' + PIndex].reload()
+        this.$refs.table.reload()
+        this.selection = []
+      },
       async warehouseChange(index, row) {
         let warehouseIds =
           this.form.datasource
@@ -459,8 +620,8 @@
             this.$message.error('请输入大于0的数');
             callback(new Error('请输入大于0的数字'));
           } else if (Number(value) > row.warehouseNum) {
-            this.$message.error('输入的数字不能大于仓库物品数');
-            callback(new Error('输入的数字不能大于仓库物品数'));
+            // this.$message.error('输入的数字不能大于仓库物品数');
+            // callback(new Error('输入的数字不能大于仓库物品数'));
             callback();
           } else if (Number(value) > row.orderTotalCount) {
             this.$message.error('输入的数字不能大于最大发货值');

+ 597 - 0
src/views/bpm/handleTask/components/saleOrder/invoice/stockLedger/components/item-list.vue

@@ -0,0 +1,597 @@
+<template>
+  <div class="itemList">
+    <!-- 数据表格 -->
+    <item-search
+      :curRow="curRow"
+      @search="reload"
+      ref="refSeavch"
+      @handledime="handledime"
+    ></item-search>
+    <ele-pro-table
+      ref="table"
+      :initLoad="false"
+      :columns="columns"
+      :datasource="datasource"
+      :row-key="selectedDime==4?'no':'code'"
+      :height="400"
+      :toolkit="[]"
+      tool-class="ele-toolbar-form"
+      cache-key="item-listTable"
+      :selection.sync="selection"
+      @done="onDone"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar></template>
+      <!-- 批次号 -->
+      <template v-slot:batchNo="{ row }">
+        <el-popover placement="right-start" width="800" trigger="hover">
+          <el-table :data="row.outInBatchDetailsVOList">
+            <el-table-column
+              width="150"
+              property="bizNo"
+              label="入库单号"
+            ></el-table-column>
+            <el-table-column
+              width="100"
+              property="bizType"
+              label="入库场景"
+            ></el-table-column>
+            <el-table-column
+              width="120"
+              property="count"
+              label="入库数量"
+            ></el-table-column>
+            <el-table-column
+              width="80"
+              property="measuringUnit"
+              label="计量单位"
+            ></el-table-column>
+            <el-table-column
+              width="100"
+              property="packageCount"
+              label="包装数量"
+            ></el-table-column>
+            <el-table-column
+              width="80"
+              property="packingUnit"
+              label="包装单位"
+            ></el-table-column>
+            <el-table-column
+              width="330"
+              property="position"
+              label="库位"
+            ></el-table-column>
+            <el-table-column
+              width="160"
+              property="createTime"
+              label="入库时间"
+            ></el-table-column>
+          </el-table>
+          <span slot="reference"> {{ row.batchNo }}</span>
+        </el-popover>
+      </template>
+      <!-- 最小包装单元 -->
+      <template v-slot:minPackingCount="{ row }">
+        <span v-if="row.minPackingCount">
+          {{ row.minPackingCount }}
+          {{ row.measuringUnit }}/{{ row.minUnit }}
+        </span>
+      </template>
+      <!-- 库存保质期 -->
+      <template v-slot:expirationDate="{ row }">
+        <span v-if="row.expirationDate">
+          {{ row.expirationDate ? row.expirationDate : '-' }}
+          {{
+            row.expirationDateUnit == 'year'
+              ? '年'
+              : row.expirationDateUnit == 'month'
+                ? '月'
+                : '日'
+          }}
+        </span>
+      </template>
+      <!-- 质检状态 -->
+      <template v-slot:qualityStatus="{ row }">
+        <span v-if="row.qualityResult == 0 || row.qualityResult == 1"
+        >已检</span
+        >
+        <span v-else-if="row.qualityStatus == 1">已检</span>
+        <span v-else-if="row.qualityStatus == 0">未检</span>
+        <span v-else>-</span>
+      </template>
+      <!-- 质检结果 -->
+      <template v-slot:qualityResult="{ row }">
+        <span v-if="row.qualityResult == 0 || row.qualityResult == ''">合格</span>
+        <span v-else-if="row.qualityResult == 1">不合格</span>
+        <span v-else-if="row.qualityResult == 3">让步接收</span>
+        <span v-else>-</span>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+import ItemSearch from './item-search.vue';
+import {getInventoryDetails, getMaterielDetails} from "@/api/bpm/components/wms";
+
+export default {
+  components: {ItemSearch},
+  props: {
+    current: {
+      type: Object,
+      default: () => ({})
+    },
+    sendProductDetail: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    curRow: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+  },
+  data() {
+    return {
+      selectedDime: '4',
+      selection: [],
+      where: {},
+      index: 0
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      // selectedDime 1物品维度 2批次维度 3包装维度 4物料维度
+      switch (this.selectedDime) {
+        // 包装维度
+        case '3':
+          return [
+            {
+              width: 45,
+              type: 'selection',
+              columnKey: 'selection',
+              reserveSelection: true,
+              selectable: (row, index) => {
+                let codes = this.sendProductDetail.map(item => item.code)
+                return !codes.includes(row.code);
+              },
+              align: 'center'
+            },
+            {
+              columnKey: 'index',
+              type: 'index',
+              width: 50,
+              align: 'center',
+              label: '序号',
+              showOverflowTooltip: true,
+              fixed: 'left'
+            },
+            {
+              slot: 'batchNum',
+              prop: 'batchNum',
+              label: '批次号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'packagingCode',
+              label: '包装编码',
+              showOverflowTooltip: true
+            },
+            // {
+            //   prop: 'packageNo',
+            //   label: '编号',
+            //   showOverflowTooltip: true
+            // },
+            {
+              prop: 'name',
+              label: '名称',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'brandNum',
+              label: '牌号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'modelType',
+              label: '型号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'specification',
+              label: '规格',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'manualBatchNo',
+              label: '批号',
+              align: 'center'
+            },
+            {
+              prop: 'barcodes',
+              label: '发货条码',
+              align: 'center'
+            },
+            {
+              prop: 'engrave',
+              label: '刻码',
+              align: 'center'
+            },
+            {
+              prop: 'packingCountBase',
+              label: '包装库存数量',
+              sortable: 'custom',
+              showOverflowTooltip: true,
+              width: 130,
+              align: 'center'
+            },
+            {
+              prop: 'minUnit',
+              label: '包装单位',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'minPackingCount',
+              slot: 'minPackingCount',
+              label: '最小包装单元',
+              showOverflowTooltip: true,
+              width: 120
+            },
+            {
+              prop: 'availableCountBase',
+              label: '计量库存数量',
+              sortable: 'custom',
+              showOverflowTooltip: true,
+              width: 130,
+              align: 'center'
+            },
+            {
+              prop: 'measuringUnit',
+              label: '计量单位',
+              align: 'center'
+            },
+            {
+              prop: 'weight',
+              label: '重量',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'weightUnit',
+              label: '重量单位',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'expirationDate',
+              slot: 'expirationDate',
+              label: '库存保质期',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'expirationTime',
+              label: '周期倒计时',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'qualityResult',
+              slot: 'qualityResult',
+              label: '质检结果',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'qualityStatus',
+              slot: 'qualityStatus',
+              label: '质检状态',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'paths',
+              width: 230,
+              label: '仓库',
+              showOverflowTooltip: true
+            },
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 100,
+              align: 'left',
+              resizable: false,
+              slot: 'action',
+              fixed: 'right'
+            }
+          ];
+        // 物料维度
+        default:
+          return [
+            {
+              width: 45,
+              type: 'selection',
+              columnKey: 'selection',
+              reserveSelection: true,
+              selectable: (row, index) => {
+                let codes = this.sendProductDetail.map(item => item.code)
+                return !codes.includes(row.no);
+              },
+              align: 'center',
+            },
+            {
+              columnKey: 'index',
+              type: 'index',
+              width: 50,
+              align: 'center',
+              label: '序号',
+              showOverflowTooltip: true,
+              fixed: 'left'
+            },
+
+            {
+              slot: 'batchNo',
+              prop: 'batchNo',
+              label: '批次号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'no',
+              label: '物料编码',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'assetCode',
+              label: '编号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'name',
+              label: '名称',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'brandNum',
+              label: '牌号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'modelType',
+              label: '型号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'specification',
+              label: '规格',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'manualBatchNo',
+              label: '批号',
+              align: 'center'
+            },
+            {
+              prop: 'barcodes',
+              label: '发货条码',
+              align: 'center'
+            },
+            {
+              prop: 'engrave',
+              label: '刻码',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'materielCode',
+              label: '物料代号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'clientCode',
+              label: '客户代号',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'availableCountBase',
+              label: '计量库存数量',
+              sortable: 'custom',
+              showOverflowTooltip: true,
+              width: 130,
+              align: 'center'
+            },
+            {
+              prop: 'measuringUnit',
+              label: '计量单位',
+              align: 'center'
+            },
+            {
+              prop: 'weight',
+              label: '重量',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'weightUnit',
+              label: '重量单位',
+              showOverflowTooltip: true
+            },
+            {
+              prop: 'expirationDate',
+              slot: 'expirationDate',
+              label: '库存保质期',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'expirationTime',
+              label: '周期倒计时',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'qualityResult',
+              slot: 'qualityResult',
+              label: '质检结果',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'qualityStatus',
+              slot: 'qualityStatus',
+              label: '质检状态',
+              showOverflowTooltip: true,
+              width: 100
+            },
+            {
+              prop: 'paths',
+              width: 230,
+              label: '仓库',
+              showOverflowTooltip: true
+            },
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 100,
+              align: 'left',
+              resizable: false,
+              slot: 'action',
+              fixed: 'right'
+            }
+          ];
+      }
+    }
+  },
+  methods: {
+    //复选框多选回显
+    onDone(res) {
+      // this.$nextTick(() => {
+      //   if (this.index > 0) return
+      //   const ids = this.selection.map(item => item.id);
+      //   this.$refs.table.setSelectedRowKeys(ids);
+      //   this.index++
+      // });
+    },
+    handledime(val) {
+      this.selectedDime = val;
+      this.reload(this.where);
+    },
+    /* 表格数据源 */
+    async datasource({page, limit, where, order}) {
+      const dimension = this.$refs.refSeavch.dimension;
+      console.log(this.current?.id);
+      const treeId = this.current?.id;
+      if (this.selectedDime == 4) {
+        // 物料维度
+        const params = {
+          categoryLevelId: treeId,
+          ...where,
+          ...order,
+          dimension: dimension,
+
+        };
+        const res = await getMaterielDetails({
+          ...params,
+          pageNum: page,
+          size: limit
+        });
+        console.log('111111')
+        const data = res.list.map((item) => {
+          return {
+            ...item,
+            minUnit: item.packingUnit,
+            paths: item.pathName,
+            availableCountBase:
+              item.availableCountBase < 0 ? 0 : item.availableCountBase,
+            packingCountBase:
+              item.packingCountBase < 0 ? 0 : item.packingCountBase,
+            materialCode: item.code,
+            batchNum: item.batchNo,
+            qualityResult:
+              typeof item.qualityResult != 'number'
+                ? 3
+                : item.qualityResult,
+            qualityStatus:
+              typeof item.qualityStatus != 'number' ? 3 : item.qualityStatus
+          };
+        });
+        return {...res, list: data};
+
+      } else {
+        // 包装维度
+        const params = {
+          categoryLevelId: treeId,
+          ...where,
+          ...order,
+          dimension: dimension
+        };
+        const data = getInventoryDetails({
+          ...params,
+          pageNum: page,
+          size: limit
+        });
+        return data.then((res) => {
+          const data = res.list.map((item) => {
+            return {
+              ...item,
+              minUnit: item.packingUnit,
+              paths: item.pathName.split(',')[0],
+              availableCountBase:
+                item.availableCountBase < 0 ? 0 : item.availableCountBase,
+              packingCountBase:
+                item.packingCountBase < 0 ? 0 : item.packingCountBase,
+              packagingCode: item.code,
+              qualityResult:
+                typeof item.qualityResult != 'number'
+                  ? 3
+                  : item.qualityResult,
+              qualityStatus:
+                typeof item.qualityStatus != 'number' ? 3 : item.qualityStatus
+            };
+          });
+          return {...res, list: data};
+        });
+      }
+    },
+    /* 刷新表格 */
+    reload(where) {
+      where.categoryCode = where.code
+      if (this.selectedDime == 4) {
+        this.$delete(where, 'categoryCode')
+      }
+      this.where = where
+      this.$nextTick(async () => {
+        await this.$refs.table.reload({
+          pageNum: 1,
+          where: {
+            ...where,
+
+            categoryLevelId: this.current?.id
+          }
+        });
+      });
+    },
+    getSelectionList() {
+      this.selection.forEach(item => item.dimension = this.selectedDime)
+      return this.selection
+    },
+  },
+
+  watch: {
+    // 监听机构id变化
+    current: {
+      handler() {
+        this.reload(this.where);
+      }
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.itemList{
+  :deep .el-checkbox__input .is-disabled .el-checkbox__inner {
+    background-color: #262626 !important;
+    border-color: #181818 !important;
+    cursor: not-allowed;
+  }
+}
+</style>

+ 203 - 0
src/views/bpm/handleTask/components/saleOrder/invoice/stockLedger/components/item-search.vue

@@ -0,0 +1,203 @@
+<!-- 搜索表单 -->
+<template>
+  <div class="itemSearch">
+    <el-form
+      label-width="80px"
+      label-position="left"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+    >
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="仓库:" prop="warehouseId">
+            <template>
+              <el-select
+                clearable
+                style="width: 100%"
+                v-model="params.warehouseId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in warehouseList"
+                  :label="item.name"
+                  :value="item.id"
+                  :key="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="列表维度:" prop="dimension">
+            <template>
+              <el-select
+                style="width: 100%"
+                clearable
+                @change="$emit('handledime', $event)"
+                v-model="dimension"
+                placeholder="请选择">
+                <el-option label="包装维度" value="3"></el-option>
+                <el-option label="物料维度" value="4"></el-option>
+              </el-select>
+            </template>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="物品编码:" prop="code">
+            <el-input
+              clearable
+              placeholder="请输入"
+              v-model.trim="params.code"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="物品名称:" prop="assetName">
+            <el-input
+              clearable
+              v-model="params.assetName"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="客户代号:" prop="clientCode">
+            <el-input
+              clearable
+              v-model="params.clientCode"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="规格:" prop="specification">
+            <el-input
+              clearable
+              v-model="params.specification"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col
+          v-if="dimension == 3 || dimension == 4"
+          v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
+        >
+          <el-form-item label="发货条码:" prop="barcodes">
+            <el-input
+              clearable
+              v-model="params.barcodes"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <div class="ele-form-actions">
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="search"
+              size="small"
+            >
+              查询
+            </el-button>
+            <el-button
+              @click="reset"
+              icon="el-icon-refresh-left"
+              size="small"
+              type="primary"
+            >重置
+            </el-button
+            >
+          </div>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+<script>
+
+import {getWarehouseList} from "@/api/bpm/components/wms";
+
+export default {
+  props: {
+    curRow: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+  },
+  data() {
+    // 默认表单数据
+    const defaultParams = {
+      informationName: '',
+      warehouseId: '',
+      manualBatchNo: '',
+      assetName: '',
+      code: '',
+      batchNo: '',
+      modelType: '',
+      clientCode: '',
+      specification: '',
+      barcodes: ''
+    };
+    return {
+      // 表单数据
+      params: {...defaultParams},
+      warehouseList: [],
+      dimension: '4'
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  created() {
+    this.getArguInfo();
+  },
+  mounted() {
+    setTimeout(() => {
+      this.setSearchParams();
+    }, 400)
+
+  },
+  methods: {
+    setSearchParams() {
+      console.log(this.curRow);
+      this.params.assetName = this.curRow.productName
+      this.params.code = this.curRow.productCode
+      this.params.modelType = this.curRow.modelType
+      this.params.clientCode = this.curRow.customerMark
+      this.params.specification = this.curRow.specification
+      this.search()
+    },
+    //搜索数据源
+    async getArguInfo() {
+      const {data} = await getWarehouseList();
+      this.warehouseList = data;
+    },
+    /* 搜索 */
+    search() {
+      this.$emit('search', {
+        ...this.params
+      });
+    },
+    /*  重置 */
+    reset() {
+      this.params = {...this.defaultParams};
+      this.search();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-row {
+  display: flex;
+  flex-wrap: wrap;
+}
+</style>

+ 145 - 0
src/views/bpm/handleTask/components/saleOrder/invoice/stockLedger/stockLedgerDialog.vue

@@ -0,0 +1,145 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="stockLedgerDialogFlag"
+    title="选择发货产品"
+    :close-on-click-modal="false"
+    width="80%"
+    append-to-body
+    :before-close="cancel">
+    <div id="stockLedger__index">
+      <el-card shadow="never">
+        <ele-split-layout
+          width="256px"
+          allow-collapse
+          :right-style="{ overflow: 'hidden' }"
+        >
+          <div class="el-tree_box">
+            <div class="ele-border-lighter sys-organization-list">
+              <el-tree
+                :data="treeList"
+                :props="defaultProps"
+                ref="treeRef"
+                style="height: 400px"
+                :default-expanded-keys="current && current.id ? [current.id] : []"
+                :highlight-current="true"
+                node-key="id"
+                @node-click="handleNodeClick"
+              ></el-tree>
+            </div>
+          </div>
+          <template v-slot:content>
+            <item-list v-if="current.id" ref="itemList" :curRow="curRow" :sendProductDetail="sendProductDetail"
+                       :current="current"/>
+          </template>
+        </ele-split-layout>
+      </el-card>
+    </div>
+    <div slot="footer">
+      <el-button type="primary" @click="handleSave">保存</el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+import itemList from './components/item-list';
+import AssetTree from '@/components/AssetTree';
+import {getTreeByGroup} from '@/api/bpm/components/wms';
+
+export default {
+  components: {itemList, AssetTree},
+  props: {
+    stockLedgerDialogFlag: Boolean
+  },
+  data() {
+    return {
+      treeData: [],
+      current: {},
+      curRow: {},
+      defaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      treeList: [],
+      treeLoading: false,
+      sendProductDetail: []
+    };
+  },
+
+  methods: {
+    init(sendProductDetail, row) {
+      this.getTreeData();
+      this.sendProductDetail = sendProductDetail
+      this.curRow = row
+    },
+    async getTreeData() {
+      try {
+        this.treeLoading = true;
+        const res = await getTreeByGroup({type: 2});
+        this.treeLoading = false;
+        if (res?.code === '0') {
+          this.treeList = res.data;
+          this.$nextTick(() => {
+            // 默认高亮第一级树节点
+            if (this.treeList[0]) {
+              this.$refs.treeRef.setCurrentKey(this.treeList[0].id);
+              this.current = this.treeList[0];
+              console.log(this.current);
+            }
+          });
+          return this.treeList;
+        }
+      } catch (error) {
+        console.log(error);
+      }
+      this.treeLoading = false;
+    },
+    handleNodeClick(data, node, el) {
+      this.current = data;
+    },
+    handleSave() {
+      this.sendProductDetail = this.$refs.itemList.getSelectionList().map(item => {
+        return {
+          code: item.no || item.code,
+          barcodes: item.barcodes,
+          engrave: item.engrave,
+          dimension: item.dimension
+        }
+      })
+      this.$emit('getStockLedger', this.sendProductDetail)
+      this.cancel()
+    },
+    cancel() {
+      this.$emit('update:stockLedgerDialogFlag', false)
+    },
+  }
+};
+</script>
+<style lang="scss" scoped>
+#stockLedger__index {
+  padding: 6px;
+
+  .el-tree_box {
+    height: 100%;
+  }
+
+  .sys-organization-list {
+    height: 550px;
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+}
+
+</style>