Kaynağa Gözat

feat: 合同管理新增销售订单来源类型及相关功能

yusheng 1 yıl önce
ebeveyn
işleme
1aee6e77ef

+ 72 - 5
src/views/contractManage/contractBook/components/addDialog.vue

@@ -131,6 +131,18 @@
               placeholder="请输入"
             />
           </el-form-item>
+          <el-form-item
+            label="销售订单"
+            prop="sourceName"
+            v-if="form.sourceType == 7"
+          >
+            <el-input
+              clearable
+              v-model="form.sourceName"
+              @click.native="handSaleOrder"
+              placeholder="请输入"
+            />
+          </el-form-item>
           <el-form-item
             label="需求类型"
             prop="requireSourceType"
@@ -599,6 +611,14 @@
       @changeParent="getReturnOrderInfo"
     >
     </return-order-dialog>
+
+    <!--  销售订单  -->
+    <saleOrderListDialog
+      ref="saleOrderListDialogRef"
+      @changeParent="changeOrder"
+      :isBoundContract="2"
+    ></saleOrderListDialog>
+
     <generate-contracts-dialog1
       :isContractBook="true"
       v-if="generateContractsDialogFlag1"
@@ -662,6 +682,9 @@
   import { listOrganizations } from '@/api/system/organization';
   import { requirementSourceType } from '@/enum/dict.js';
   import { listCode, getCode } from '@/components/addDoc/api/index.js';
+  import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue'; //销售订单
+  import { getSaleOrderDetail } from '@/api/saleManage/saleorder';
+
   export default {
     props: {
       isRequired: {
@@ -706,7 +729,8 @@
       quotationList,
       // fileMain,
       inventoryTable1,
-      personSelect
+      personSelect,
+      saleOrderListDialog
     },
     data() {
       let formDef = {
@@ -818,6 +842,11 @@
             code: 6,
             name: '客户',
             parentId: '1'
+          },
+          {
+            code: 7,
+            name: '销售订单',
+            parentId: '1'
           }
         ],
         categoryList: [],
@@ -1489,10 +1518,10 @@
           contractVO.type == '2' ? contractVO.partbId : contractVO.partaId
         );
         if (contractVO.discountTotalPrice) {
-          this.$refs.inventoryTable.allPrice=contractVO.totalPrice
-            this.$refs.inventoryTable.discountInputByOrder(
-              contractVO.discountTotalPrice
-            );
+          this.$refs.inventoryTable.allPrice = contractVO.totalPrice;
+          this.$refs.inventoryTable.discountInputByOrder(
+            contractVO.discountTotalPrice
+          );
         }
         this.$nextTick(() => {
           this.getrequireUser(contractVO.requireDeptId);
@@ -1745,6 +1774,7 @@
         }
         this.$refs.quotationListRef.open();
       },
+
       //核价单
       async changeInquiryList({ data, sourceId, sourceName }) {
         console.log(sourceId, sourceName);
@@ -1781,6 +1811,7 @@
         this.$set(this.form, 'sourceName', sourceCode);
         this.$set(this.form, 'sourceId', data.contractVO.sourceId);
       },
+
       //选择采购计划
       handPlan(e) {
         if (e.target.nodeName == 'I') {
@@ -1897,6 +1928,42 @@
         return Promise.resolve(await getOpportunityInfo(id));
       },
 
+      // 选择销售订单
+      handSaleOrder(e) {
+        if (e.target.nodeName == 'I') {
+          this.$set(this.form, 'sourceName', '');
+          this.$set(this.form, 'sourceId', '');
+          return;
+        }
+        this.$refs.saleOrderListDialogRef.open();
+      },
+      async changeOrder(row) {
+        let data = await getSaleOrderDetail(row.id);
+        this.$set(this.form, 'sourceName', data.orderNo);
+        this.$set(this.form, 'sourceId', row.id);
+        [
+          'createTime',
+          'createUserId',
+          'createUserName',
+          'processInstanceId',
+          'progress',
+          'id'
+        ].forEach((key) => {
+          delete data[key];
+        });
+        let form = {
+          contractVO: {
+            ...this.form,
+            ...data,
+            hasGeneratedOrder:1,
+            totalPrice: data.totalAmount,
+            discountTotalPrice: data.payAmount
+          },
+          productList: data.productList || []
+        };
+        this.setValue(form);
+      },
+
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';

+ 20 - 3
src/views/contractManage/contractBook/components/detailDialog.vue

@@ -38,7 +38,12 @@
             </el-form-item>
 
             <el-form-item label="来源类型" v-if="form.type">
-              <el-select v-model="form.sourceType" style="width: 100%" disabled placeholder=" ">
+              <el-select
+                v-model="form.sourceType"
+                style="width: 100%"
+                disabled
+                placeholder=" "
+              >
                 <el-option
                   v-if="item.parentId == form.type"
                   v-for="item in sourceTypeList"
@@ -77,6 +82,13 @@
             >
               <el-input v-model="form.sourceName" disabled></el-input>
             </el-form-item>
+            <el-form-item
+              label="销售订单:"
+              prop="sourceName"
+              v-if="form.sourceType == 7"
+            >
+              <el-input v-model="form.sourceName" disabled></el-input>
+            </el-form-item>
             <el-form-item label="合同名称:" prop="contractName">
               <el-input v-model="form.contractName" disabled></el-input>
             </el-form-item>
@@ -218,7 +230,7 @@
             :isCustomerMark="form.type == '1'"
             :isDiscountTotalPrice="true"
             :contractBookType="form.type"
-              :isArrivalWay="true"
+            :isArrivalWay="true"
             :pricingWay="form.pricingWay"
             :isChangeCount="false"
             :cacheKeyUrl="cacheKeyUrl"
@@ -340,8 +352,13 @@
             code: 6,
             name: '客户',
             parentId: '1'
+          },
+          {
+            code: 7,
+            name: '销售订单',
+            parentId: '1'
           }
-        ],
+        ]
       };
     },
     methods: {

+ 1 - 1
src/views/contractManage/contractBook/index.vue

@@ -111,7 +111,7 @@
                   type="primary"
                   v-if="
                     [2].includes(row.status) &&
-                    !row.hasGeneratedOrder &&
+                    !row.hasGeneratedOrder &&row.sourceType!=7&&
                     row.type == 1
                   "
                   :underline="false"

+ 1 - 0
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -498,6 +498,7 @@
       ref="selectContractRef"
       @changeParent="changeContract"
       :contactData="contactData"
+      :isCreatedByOrder="2"
     ></contractListDialog>
     <projectListDialog
       :contactData="contactData"

+ 14 - 7
src/views/saleManage/saleOrder/components/contractListDialog.vue

@@ -101,13 +101,17 @@
         default: false,
         type: Boolean
       },
-      isAdd: { //对账单选择合同 
+      isAdd: {
+        //对账单选择合同
         default: false,
         type: Boolean
       },
-      sourceType:{
+      sourceType: {
         default: '',
         type: String
+      },
+      isCreatedByOrder: {
+        default: 0
       }
     },
     data() {
@@ -277,12 +281,15 @@
         if (this.type) {
           where['type'] = this.type;
         }
-        if(this.isChange){
-          where['ifRelation'] =0;
+        if (this.isChange) {
+          where['ifRelation'] = 0;
         }
-        if(this.sourceType){
+        if (this.sourceType) {
           where['requireSourceType'] = this.sourceType;
         }
+        if (this.isCreatedByOrder) {
+          where['isCreatedByOrder'] = this.isCreatedByOrder;
+        }
         let params = {
           pageNum: page,
           size: limit,
@@ -335,12 +342,12 @@
         if (this.isChange) {
           this.$emit('changeParent', this.current, this.currentIndex);
           this.handleClose();
-          return
+          return;
         }
         if (this.isAdd) {
           this.$emit('changeParent', this.current, this.currentIndex);
           this.handleClose();
-          return
+          return;
         }
         if (this.current.hasGeneratedOrder > 0 && !(await this.addConfirm())) {
           return;

+ 1537 - 0
src/views/saleManage/saleOrder/invoice/components/inventoryTable copy.vue

@@ -0,0 +1,1537 @@
+<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"
+      @cell-click="handleClick"
+    >
+      <!-- 表头工具栏 -->
+      <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()"
+          >
+            新增
+          </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'"
+          v-if="currentKey == $index + 1"
+        >
+          <el-input
+            clearable
+            v-model="row.remark"
+            type="textarea"
+            placeholder="请输入"
+          />
+        </el-form-item>
+        <div v-else>{{ row.remark }}</div>
+      </template>
+
+      <template v-slot:packagingStrength="scope">
+        <el-form-item v-if="currentKey == scope.$index + 1">
+          <DictSelection
+            dict-name="包装强度"
+            @change="keyChange(scope.$index, scope.row, 'packagingStrength')"
+            v-model="scope.row.extField.packagingStrength"
+            :isOne="scope.$index === 0"
+          ></DictSelection>
+        </el-form-item>
+        <div v-else>{{ scope.row.extField?.packagingStrength }}</div>
+      </template>
+      <template v-slot:packagingDensity="scope">
+        <el-form-item v-if="currentKey == scope.$index + 1">
+          <DictSelection
+            dict-name="包装密度"
+            @change="keyChange(scope.$index, scope.row, 'packagingDensity')"
+            v-model="scope.row.extField.packagingDensity"
+            :isOne="scope.$index === 0"
+          ></DictSelection>
+        </el-form-item>
+         <div v-else>{{ scope.row.extField?.packagingDensity }}</div>
+      </template>
+
+      <template v-slot:batchNo="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.batchNo'"
+          v-if="currentKey == scope.$index + 1"
+        >
+          <el-input v-model="scope.row.batchNo" v-no-chinese></el-input>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.batchNo }}
+        </div>
+      </template>
+      <!-- 生产编号 可编辑 -->
+      <template v-slot:productionCodes="{ row, $index }">
+        <el-form-item v-if="currentKey == $index + 1">
+          <el-input v-model="row.productionCodes" v-no-chinese></el-input>
+        </el-form-item>
+        <div v-else>
+          {{ row.batchNo }}
+        </div>
+      </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
+          v-if="currentKey == scope.$index + 1"
+          :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
+        >
+          <el-input-number
+            :controls="false"
+            v-model="scope.row.receiveTotalWeight"
+            @input="changeSendTotalWeight(scope.row, scope.$index)"
+            style="width: 60%; margin-right: 10px"
+          >
+          </el-input-number>
+          <el-button
+            size="small"
+            type="primary"
+            v-if="entrustedCode"
+            @click.native="(e) => handleInnerBound(e, scope.row, scope.$index)"
+            >选择
+          </el-button>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.receiveTotalWeight }}
+        </div>
+      </template>
+      <template v-slot:sendTotalWeight="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
+          v-if="currentKey == scope.$index + 1"
+        >
+          <el-input-number
+            :controls="false"
+            v-model="scope.row.sendTotalWeight"
+            style="width: 100%"
+            @input="changeSendTotalWeight(scope.row, scope.$index)"
+          >
+          </el-input-number>
+        </el-form-item>
+        <div v-else> {{ scope.row.sendTotalWeight }} </div>
+      </template>
+      <template v-slot:increaseTotalWeight="scope">
+        <el-form-item
+          v-if="currentKey == scope.$index + 1"
+          :prop="'datasource.' + scope.$index + '.increaseTotalWeight'"
+        >
+          <el-input-number
+            :controls="false"
+            v-model="scope.row.increaseTotalWeight"
+            style="width: 100%"
+          >
+          </el-input-number>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.increaseTotalWeight }}
+        </div>
+      </template>
+      <template v-slot:warehouseId="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.warehouseId'"
+          v-if="currentKey == scope.$index + 1"
+          :rules="[
+            {
+              required: isWarehouseId == 1 ? true : false,
+              message: '请选择仓库',
+              trigger: 'blur'
+            }
+          ]"
+        >
+          <el-select
+            v-model="scope.row.warehouseId"
+            placeholder="请选择"
+            @change="warehouseChange(scope.$index, scope.row)"
+          >
+            <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>
+        <div v-else>
+          {{ scope.row.warehouseName }}
+        </div>
+      </template>
+
+      <template v-slot:singlePrice="scope">
+        <el-form-item
+          v-if="currentKey == scope.$index + 1"
+          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"
+          >
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.singlePrice }}
+        </div>
+      </template>
+
+      <template v-slot:singleWeight="scope" v-if="needProduce == 4">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :rules="{
+            required: false,
+
+            trigger: 'change'
+          }"
+          :prop="'datasource.' + scope.$index + '.singleWeight'"
+          v-if="currentKey == scope.$index + 1"
+        >
+          <el-input
+            v-model="scope.row.singleWeight"
+            type="number"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.singleWeight }}
+        </div>
+      </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'
+          }"
+        >
+          <el-input
+            v-model="scope.row.saleCount"
+            placeholder="请输入"
+            type="number"
+            :min="0"
+            @input="changeCount(scope.row, scope.$index, false)"
+          >
+          </el-input>
+        </el-form-item>
+        <!-- <div v-else>
+          {{ scope.row.saleCount }}
+        </div> -->
+      </template>
+      <template v-slot:saleUnit="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.saleUnitId'"
+          v-if="currentKey == scope.$index + 1"
+        >
+          <el-select
+            v-model="scope.row.saleUnitId"
+            style="width: 100%"
+            @change="changeCount(scope.row, scope.$index)"
+            :disabled="clientEnvironmentId == 4"
+          >
+            <el-option
+              :label="item.conversionUnit"
+              :value="item.id"
+              @click.native="packingChange(item, scope.$index)"
+              v-for="(item, index) in scope.row.packageDispositionList"
+              :key="index"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.saleUnit }}
+        </div>
+      </template>
+      <template v-slot:modelKey="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.' + 'modelKey'"
+          v-if="currentKey == scope.$index + 1"
+        >
+          <DictSelection
+            dictName="物品机型"
+            clearable
+            v-model="scope.row.modelKey"
+            :isOne="scope.$index === 0"
+            filterable
+            allow-create
+            default-first-option
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.modelKey?.toString() }}
+        </div>
+      </template>
+      <template v-slot:colorKey="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.' + 'colorKey'"
+          v-if="currentKey == scope.$index + 1"
+        >
+          <DictSelection
+            dictName="物品颜色"
+            clearable
+            v-model="scope.row.colorKey"
+            :isOne="scope.$index === 0"
+            filterable
+            allow-create
+            default-first-option
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+        <div v-else>
+          {{ scope.row.colorKey?.toString() }}
+        </div>
+      </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>
+    <product-list
+      ref="productListRef"
+      :orderId="orderId"
+      @changeParent="changeParent"
+    ></product-list>
+    <!--入库详情-->
+    <innertboundDetailsDialog
+      v-if="innerboundDetailsDialogFlag"
+      ref="innerboundDetailsDialogRef"
+      :innerboundDetailsDialogFlag.sync="innerboundDetailsDialogFlag"
+      @saveDate="saveInnerDate"
+    ></innertboundDetailsDialog>
+    <!-- 库存台账   -->
+    <stock-ledger-dialog
+      v-if="stockLedgerDialogFlag"
+      :stock-ledger-dialog-flag.sync="stockLedgerDialogFlag"
+      ref="stockLedgerDialogRef"
+      @getStockLedger="getStockLedger"
+    ></stock-ledger-dialog>
+    <selectStockLedgerDialog
+      ref="selectStockLedgerDialogRef"
+      @changeParent="replaceTable"
+    ></selectStockLedgerDialog>
+    <BIZproductList
+      ref="BIZproductListRef"
+      classType="1"
+      :isGetInventoryTotal="true"
+      @changeParent="changeParentBiz"
+      :typeIds="typeIds"
+      :isFirstRefreshTable="true"
+    ></BIZproductList>
+  </el-form>
+</template>
+<script>
+  import { numberReg } from 'ele-admin';
+  import dictMixins from '@/mixins/dictMixins';
+  import productList from './product-list.vue';
+  import {
+    getWarehouseOutStock,
+    getIdWarehouseList
+  } from '@/api/saleManage/saleorder';
+
+  import { copyObj } from '@/utils/util';
+  import { getFile } from '@/api/system/file';
+  import innertboundDetailsDialog from '@/BIZComponents/innerboundDetailsDialog.vue';
+  import stockLedgerDialog from './stockLedger/stockLedgerDialog.vue';
+
+  import getDynamicsColumns from '@/mixins/getDynamicsColumns';
+  // import fileMain from '@/components/addDoc/index.vue';
+  import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
+  import BIZproductList from '@/BIZComponents/product-list.vue';
+  import { lbjtList } from '@/enum/dict.js';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { levelList } from '@/enum/dict.js';
+  import { changeCount } from '@/BIZComponents/setProduct.js';
+  import { parameterGetByCode } from '@/api/main/index.js';
+  import { getSummaries } from '@/utils/util.js';
+
+  export default {
+    mixins: [dictMixins, getDynamicsColumns, tabMixins],
+    props: {
+      orderId: String,
+      orderIds: String,
+      needProduce: [String, Number],
+      entrustedCode: String,
+      pricingWay: [String, Number],
+      isShowAdd: {
+        type: Boolean,
+        default: true
+      },
+      typeIds: {
+        type: Array,
+        default: () => []
+      },
+      isTotalCount: {
+        default: 0
+      }
+    },
+    components: {
+      // fileMain,
+      innertboundDetailsDialog,
+      productList,
+      stockLedgerDialog,
+      selectStockLedgerDialog,
+      BIZproductList
+    },
+    data() {
+      const defaultForm = {
+        key: null,
+        endTime: '',
+        isFirst: 0,
+        name: '',
+        startTime: '',
+        workHour: '',
+        technicalDrawings: []
+        // warehouseCode:"",
+        // warehouseId:'',
+        // warehouseName:'',
+      };
+      return {
+        cacheKeyUrl: 'eos-saleManage-invoice-inventoryTable',
+        current: {},
+        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: [],
+        discountTotalPrice: 0.0,
+        allPrice: 0.0,
+        curIndex: null,
+        innerboundDetailsDialogFlag: false,
+        stockLedgerDialogFlag: false,
+        numberReg,
+        defaultForm,
+        warehouseList: [],
+        dynamicsColumns: [],
+        columnsVersion: 1,
+        isWarehouseId: 0,
+        blockCountColumn: {},
+        currentKey: null,
+        form: {
+          datasource: []
+        },
+        rules: {}
+      };
+    },
+    created() {
+      this.getColumns();
+      this.requestDict('产地');
+      this.requestDict('生产类型');
+      parameterGetByCode({
+        code: 'eom_saleManage_invoice_warehouseId'
+      }).then((res) => {
+        if (res.value) {
+          this.isWarehouseId = res.value;
+        }
+      });
+    },
+    computed: {
+      canHandl() {
+        return this.form.datasource.length;
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      },
+      columns() {
+        return [
+          {
+            width: 60,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            minWidth: 150,
+            prop: 'orderNo',
+            label: '订单编码',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 200,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'productCategoryName',
+            label: '类型',
+            slot: 'productCategoryName',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'batchNo',
+            label: '批次号',
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'modelKey',
+            label: '机型',
+            slot: 'modelKey',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'colorKey',
+            label: '颜色',
+            slot: 'colorKey',
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'productionCodes',
+            label: '生产编号',
+            align: 'center',
+            slot: 'productionCodes'
+          },
+
+          {
+            minWidth: 120,
+            prop: 'goodsLevel',
+            label: '物品级别',
+            formatter: (_row, _column, cellValue) => {
+              return levelList.find((item) => item.value == _row.goodsLevel)
+                ?.label;
+            },
+            align: 'center'
+          },
+          ...this.dynamicsColumns,
+
+          {
+            width: 120,
+            prop: 'customerMark',
+            label: '客户代号',
+            slot: 'customerMark',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'warehouseId',
+            label: '仓库名称',
+            slot: 'warehouseId',
+            headerSlot: 'headerWarehouseId',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'warehouseNum',
+            label: '库存',
+            align: 'center',
+            slot: 'warehouseNum'
+          },
+
+          // {
+          //   width: 100,
+          //   prop: 'stockLedger',
+          //   label: '发货明细',
+          //   slot: 'stockLedger',
+          //   align: 'center'
+          // },
+
+          {
+            width: 150,
+            prop: 'saleCount',
+            label: '发货数量',
+            slot: 'saleCount',
+            headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'saleUnit',
+            label: '单位',
+            slot: 'saleUnit',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '计量数量',
+            // slot: 'totalCount',
+            // headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'orderTotalCount',
+            label: '订单数量',
+            slot: 'orderTotalCount',
+            align: 'center'
+          },
+
+          {
+            width: 80,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
+          this.clientEnvironmentId == 4
+            ? {
+                width: 150,
+                prop: 'blockCount',
+                label: '发货块数',
+                slot: 'blockCount',
+                align: 'center'
+              }
+            : { width: 1 },
+
+          {
+            width: 120,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'receiveTotalWeight',
+            label: '收货总重',
+            slot: 'receiveTotalWeight',
+            align: 'center',
+            headerSlot: 'headerReceiveTotalWeight'
+          },
+          {
+            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: 'pricingWay',
+          //   label: '计价方式',
+          //   slot: 'pricingWay',
+          //   align: 'center',
+          //   formatter: (row, column) => {
+          //     return row.pricingWay == 1
+          //       ? '按数量计费'
+          //       : row.pricingWay == 2
+          //       ? '按重量计费'
+          //       : '';
+          //   }
+          // },
+          {
+            width: 180,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'taxRate',
+            label: '税率',
+            formatter: (_row, _column, cellValue) => {
+              return _row.taxRate ? _row.taxRate + '%' : '';
+            },
+            align: 'center'
+          },
+          {
+            width: 180,
+            prop: 'notaxSinglePrice',
+            label: '不含税单价',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'notaxTotalPrice',
+            label: '含税合计',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            showOverflowTooltip: true
+          },
+          {
+            width: 120,
+            prop: 'produceType',
+            align: 'center',
+            label: '属性类型',
+            formatter: (row, column) => {
+              if (row.produceType) {
+                return row.produceType
+                  .map((item) => {
+                    return lbjtList[item];
+                  })
+                  .toString();
+              }
+            },
+            showOverflowTooltip: true
+          },
+          // {
+          //   width: 80,
+          //   prop: 'deliveryDays',
+          //   label: '交期(天)',
+          //   slot: 'deliveryDays',
+          //   align: 'center'
+          // },
+
+          {
+            width: 200,
+            prop: 'guaranteePeriod',
+            label: '有效期',
+            slot: 'guaranteePeriod',
+            formatter: (_row, _column, cellValue) => {
+              let val = '';
+              if (_row.guaranteePeriod) {
+                val += _row.guaranteePeriod;
+              }
+              if (_row.guaranteePeriodUnitName) {
+                val += _row.guaranteePeriodUnitName;
+              }
+              return val;
+            },
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'guaranteePeriodDeadline',
+            label: '有效期截止日期',
+            slot: 'guaranteePeriodDeadline',
+            align: 'center'
+          },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            // show:this.contractBookType==2,
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
+          {
+            width: 130,
+            prop: 'technicalAnswerName',
+            label: '技术答疑人',
+            slot: 'technicalAnswerName',
+            align: 'center'
+          },
+          {
+            width: 220,
+            prop: 'technicalParams',
+            label: '技术参数',
+            slot: 'technicalParams',
+            align: 'center'
+          },
+          {
+            width: 240,
+            prop: 'technicalDrawings',
+            label: '技术图纸',
+            slot: 'technicalDrawings',
+            align: 'center'
+          },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 180,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ];
+      }
+    },
+    mounted() {
+      // this.clientEnvironmentId =
+    },
+    methods: {
+      getSummaries(param) {
+        if (this.clientEnvironmentId != 4) {
+          return;
+        }
+
+        return getSummaries(
+          param,
+          ['saleCount', 'blockCount', 'totalCount'],
+          ' '
+        );
+      },
+      handleClick(row, column, cell) {
+        this.currentKey = row.key;
+        console.log(row, 'data');
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      //发货明细选择
+      stockLedgerSelect(row, index) {
+        this.curIndex = index;
+        this.stockLedgerDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.stockLedgerDialogRef.init(row.sendProductDetail, row);
+        });
+      },
+
+      // changeCount1(row, index) {
+      //   this.tableHandleKeyUp(row, index, 'sum');
+      //   this.changeCount(row, index);
+      // },
+      packingChange(item, index) {
+        this.$set(this.form.datasource[index], 'saleUnit', item.conversionUnit);
+      },
+      //改变数量
+      // changeCount() {
+      //   this.form.datasource.forEach((item, index) => {
+      //     if (item.pricingWay == 1) {
+      //       this.$set(
+      //         this.form.datasource[index],
+      //         'discountTotalPrice',
+      //         item.discountSinglePrice * item.totalCount
+      //       );
+      //       this.$set(
+      //         this.form.datasource[index],
+      //         'totalPrice',
+      //         item.singlePrice * item.totalCount
+      //       );
+      //     }
+      //     if (item.pricingWay == 2) {
+      //       this.$set(
+      //         this.form.datasource[index],
+      //         'discountTotalPrice',
+      //         item.discountSinglePrice *
+      //           item.totalCount *
+      //           (item.singleWeight || 0)
+      //       );
+      //       this.$set(
+      //         this.form.datasource[index],
+      //         'totalPrice',
+      //         item.singlePrice * item.totalCount * (item.singleWeight || 0)
+      //       );
+      //     }
+      //   });
+      // },
+      //获取
+      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) {
+        const data = row.warehouseList.find(
+          (item) => item.warehouseId == row.warehouseId
+        );
+
+        this.$set(
+          this.form.datasource[index],
+          'warehouseName',
+          data.warehouseName
+        );
+        this.$set(
+          this.form.datasource[index],
+          'warehouseCode',
+          data.warehouseCode
+        );
+        const warehouseOutStock = await getWarehouseOutStock({
+          warehouseId: data.warehouseId,
+          code: row.productCode
+        });
+        this.$set(
+          this.form.datasource[index],
+          'warehouseNum',
+          warehouseOutStock || 0
+        );
+      },
+      //改变数量
+      changeCount(row, index, isBlockCount = true) {
+        this.$set(
+          this.form,
+          'datasource[' + index + ']',
+          changeCount(row, {
+            countKey: 'saleCount',
+            unitKey: 'saleUnit',
+            unitIdKey: 'saleUnitId'
+          })
+        );
+        this.$set(
+          this.form.datasource[index],
+          'sendTotalWeight',
+          this.form.datasource[index].totalWeight
+        );
+        this.changeSendTotalWeight(row, index);
+        this.getNotaxSinglePrice();
+        this.$forceUpdate();
+        if (this.clientEnvironmentId == 4 && !isBlockCount) {
+          this.tableHandleKeyUp(row, index, 'sum');
+        }
+      },
+      //修改发货总重
+      changeSendTotalWeight(row, index) {
+        this.curIndex = index;
+        this.setIcreaseTotalWeight(row);
+      },
+      keyChange(index, row, key) {
+        this.$set(
+          this.form.datasource[index],
+          'extField.' + key,
+          row.extField[key]
+        );
+        this.$forceUpdate();
+      },
+      //设置增重总重
+      setIcreaseTotalWeight(row) {
+        let receiveTotalWeight = Number(
+          this.form.datasource[this.curIndex]?.receiveTotalWeight
+        );
+        let sendTotalWeight = Number(
+          this.form.datasource[this.curIndex]?.sendTotalWeight
+        );
+        if (sendTotalWeight && receiveTotalWeight) {
+          this.$set(
+            this.form.datasource[this.curIndex],
+            'increaseTotalWeight',
+            (sendTotalWeight - receiveTotalWeight).toFixed(2)
+          );
+        }
+
+        this.$refs.table.reload();
+        this.$forceUpdate();
+      },
+      //计算不含税单价
+      getNotaxSinglePrice() {
+        this.form.datasource.forEach((item, index) => {
+          if (item.singlePrice && item.taxRate) {
+            this.$set(
+              this.form.datasource[index],
+              'notaxSinglePrice',
+              parseFloat(
+                (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
+              )
+            );
+          } else {
+            this.$set(this.form.datasource[index], 'notaxSinglePrice', '');
+          }
+        });
+      },
+      //入库单详情
+      handleInnerBound(e, rows, index) {
+        this.curIndex = index;
+        this.innerboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          let row = {
+            code: this.entrustedCode
+          };
+          this.$refs.innerboundDetailsDialogRef.init(row);
+        });
+      },
+      //选择入库单信息
+      saveInnerDate(data = []) {
+        let totalWeight = data.reduce((num, row) => {
+          num += Number(row.weight);
+          return num;
+        }, 0);
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'receiveTotalWeight',
+          totalWeight
+        );
+        console.log(totalWeight, 'totalWeight');
+        this.setIcreaseTotalWeight(this.form.datasource[this.curIndex]);
+      },
+
+      // getWeightPrice() {
+      //   let increaseTotalWeight =
+      //     this.form.datasource[this.curIndex].increaseTotalWeight;
+      //   let singlePrice = this.form.datasource[this.curIndex].singlePrice;
+      //   let discountSinglePrice =
+      //     this.form.datasource[this.curIndex].discountSinglePrice;
+      //   this.$set(
+      //     this.form.datasource[this.curIndex],
+      //     'totalPrice',
+      //     (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2)
+      //   );
+      //   this.$set(
+      //     this.form.datasource[this.curIndex],
+      //     'discountTotalPrice',
+      //     (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(2)
+      //   );
+      // },
+
+      // 表格:模数、数量(方)、块数输入框 输入事件
+      tableHandleKeyUp(row, index, name) {
+        if (row.specification) {
+          let modelArr = row.specification.split('*');
+          let modelLong = modelArr[0]; // model规格长度
+          let modeWide = modelArr[1]; // model规格宽度
+          let modeHight = modelArr[2].substr(0, modelArr[2].indexOf('cm')); // model规格高度
+          modeHight = Number(modeHight);
+          if (name === 'sum') {
+            row.blockCount = Math.floor(
+              row.totalCount / ((modelLong * modeWide * modeHight) / 1000000)
+            );
+          } else if (name === 'blockCount') {
+            row.totalCount =
+              (Number(row.blockCount) * modelLong * modeWide * modeHight) /
+              1000000;
+            row.saleCount = row.totalCount;
+            this.changeCount(row, index, true);
+          }
+        }
+      },
+
+      //选择产品回调
+      async changeParent(obj, idx) {
+        obj.orderTotalCount = obj.totalCount;
+        if (this.form.datasource?.find((item) => item.id == obj.id)) {
+          return this.$message.error('选择的产品已经存在列表了');
+        }
+        obj.id = '';
+        obj['tempId'] = idx;
+        this.$set(
+          this.form.datasource,
+          this.form.datasource.length,
+          copyObj(obj)
+        );
+      },
+      //选择产品回调
+      changeParentBiz(obj = [], idx) {
+        obj.forEach(async (item, index) => {
+          let i = idx == -1 ? index : idx;
+          let row = JSON.parse(JSON.stringify(this.defaultForm));
+
+          let parasm = idx == -1 ? row : this.form.datasource[i];
+          this.$set(parasm, 'productId', item.id);
+          this.$set(parasm, 'categoryName', item.name);
+          this.$set(parasm, 'productCategoryId', item.categoryLevelId);
+          this.$set(parasm, 'productBrand', item.brandNum);
+          this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
+          this.$set(parasm, 'productCode', item.code);
+          this.$set(parasm, 'productName', item.name);
+          this.$set(parasm, 'modelType', item.modelType);
+          this.$set(parasm, 'availableCountBase', item.availableCountBase);
+          this.$set(parasm, 'measuringUnit', item.measuringUnit);
+          this.$set(parasm, 'specification', item.specification);
+          this.$set(parasm, 'weightUnit', item.weightUnit);
+          this.$set(parasm, 'imgCode', item.imgCode);
+          this.$set(parasm, 'produceType', item.componentAttribute);
+          this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
+          this.$set(parasm, 'extField', item.extField || {});
+          this.$set(parasm, 'singleWeight', item.netWeight);
+          this.$set(parasm, 'pricingWay', item.pricingWay || 1);
+          this.$set(parasm, 'singlePrice', 0);
+          this.$set(parasm, 'discountSinglePrice', 0);
+          this.$set(parasm, 'goodsLevel', item.goodsLevel);
+          if (item.modelKey) {
+            this.$set(parasm, 'modelKey', item.modelKey.split(','));
+          }
+          if (item.colorKey) {
+            this.$set(parasm, 'colorKey', item.colorKey.split(','));
+          }
+          this.$set(parasm, 'receiveTotalWeight', 0);
+          this.$set(parasm, 'sendTotalWeight', 0);
+          this.$set(parasm, 'increaseTotalWeight', 0);
+          this.$set(
+            parasm,
+            'packageDispositionList',
+            item.packageDispositionList
+          );
+
+          if (item.packageDispositionList?.length) {
+            this.$set(parasm, 'saleUnitId', item.packageDispositionList[0].id);
+            this.$set(
+              parasm,
+              'saleUnit',
+              item.packageDispositionList[0].conversionUnit
+            );
+          }
+          this.$set(
+            parasm,
+            'warehouseList',
+            await getIdWarehouseList({
+              categoryId: item.id
+            })
+          );
+          this.$set(
+            parasm,
+            'packingSpecification',
+            item.extField?.packingSpecification
+          );
+          this.$set(
+            parasm,
+            'supplierMark',
+            this.form.datasource[0]?.supplierMark
+          );
+          if (item.purchaseOrigins?.length > 0) {
+            item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
+          }
+          this.$set(parasm, 'provenance', item.purchaseOrigins || []);
+          if (idx == -1) {
+            row.key = this.form.datasource.length + 1;
+            this.form.datasource.push(row);
+          }
+        });
+      },
+      replaceTable(list) {
+        list.forEach((item) => {
+          item['relationId'] = this.current.tempId;
+        });
+        this.$emit('replaceTableChange', list);
+      },
+      // validateTotalCount(row) {
+      //   return (rule, value, callback) => {
+      //     if (isNaN(value) || Number(value) <= 0) {
+      //       this.$message.error('请输入大于0的数');
+      //       callback(false);
+      //     } else else {
+      //       callback();
+      //     }
+      //   };
+      // },
+      // 返回列表数据
+      getTableValue() {
+        let comitDatasource = this.form.datasource;
+        if (comitDatasource.length === 0) return [];
+        comitDatasource.forEach(async (v) => {
+          if (v.modelKey) {
+            v.modelKey = v.modelKey.toString();
+          }
+          if (v.colorKey) {
+            v.colorKey = v.colorKey.toString();
+          }
+          v.totalCount = Number(v.totalCount);
+          v.technicalDrawings = Array.isArray(v.technicalDrawings)
+            ? v.technicalDrawings
+            : [];
+          v.customerReqFiles = Array.isArray(v.customerReqFiles)
+            ? v.customerReqFiles
+            : [];
+          v.industryArtFiles = v.industryArtFiles || [];
+          v.otherFiles = v.otherFiles || [];
+        });
+        return comitDatasource;
+      },
+      getPrice() {
+        return [this.allPrice];
+      },
+
+      //修改回显
+      putTableValue(data) {
+        if (data) {
+          this.form.datasource = data;
+          this.form.datasource.forEach(async (item, index) => {
+            item.key = index + 1;
+            if (item.modelKey) {
+              this.$set(
+                this.form.datasource[index],
+                'modelKey',
+                item.modelKey.split(',')
+              );
+            }
+            if (item.colorKey) {
+              this.$set(
+                this.form.datasource[index],
+                'colorKey',
+                item.colorKey.split(',')
+              );
+            }
+            this.$set(
+              this.form.datasource[index],
+              'warehouseList',
+              await getIdWarehouseList({
+                categoryId: item.productId
+              })
+            );
+            if (item.warehouseId) {
+              this.$set(
+                this.form.datasource[index],
+                'warehouseNum',
+                await getWarehouseOutStock({
+                  warehouseId: item.warehouseId,
+                  code: item.productCode
+                })
+              );
+            } else if (this.form.datasource[index]?.warehouseList?.length) {
+              this.$set(
+                this.form.datasource[index],
+                'warehouseId',
+                this.form.datasource[index]?.warehouseList[0].warehouseId
+              );
+              await this.warehouseChange(index, this.form.datasource[index]);
+            }
+
+            this.$set(
+              this.form.datasource[index],
+              'receiveTotalWeight',
+              item.receiveTotalWeight || 0
+            );
+            if (item.weightUnit == item.measuringUnit) {
+              item.sendTotalWeight = item.sendTotalWeight || item.totalCount;
+            } else {
+              item.sendTotalWeight =
+                item.sendTotalWeight ||
+                Number(item.totalCount) * Number(item.singleWeight) ||
+                0;
+            }
+
+            if (this.outsourceSendCode) {
+              item.increaseTotalWeight =
+                Number(item.receiveTotalWeight) - Number(item.sendTotalWeight);
+              item.increaseTotalWeight;
+            } else {
+              item.increaseTotalWeight =
+                item.increaseTotalWeight || item.receiveTotalWeight || 0;
+            }
+            this.$set(
+              this.form.datasource[index],
+              'sendTotalWeight',
+              item.sendTotalWeigh
+            );
+            this.$set(
+              this.form.datasource[index],
+              'increaseTotalWeight',
+              item.increaseTotalWeight
+            );
+            console.log(item.increaseTotalWeight);
+          });
+          //保存初始收货总重
+          this.oldReceiveTotalWeight = this.form.datasource.map((item) => {
+            return {
+              productCode: item.productCode,
+              oldReceiveTotalWeight: item.receiveTotalWeight
+            };
+          });
+        }
+      },
+
+      remove(i) {
+        this.form.datasource.splice(i, 1);
+        this.setSort();
+      },
+
+      // 重新排序
+      setSort() {
+        this.form.datasource.forEach((n, index) => {
+          n.key = index + 1;
+        });
+      },
+      //选择产品
+      handParent() {
+        if (!this.orderId && !this.orderIds)
+          return this.$message.error('请先选择订单');
+        this.$refs.BIZproductListRef.open('', -1);
+      },
+      // 添加
+      handlAdd() {
+        if (!this.orderId && !this.orderIds)
+          return this.$message.error('请先选择订单');
+        this.$refs.productListRef.open(this.form.datasource);
+      },
+      //库存台账
+      selectStockLedgerDialogOpen(row) {
+        this.current = row;
+        this.$refs.selectStockLedgerDialogRef.open();
+      },
+      validateForm(callback) {
+        //开始表单校验
+        this.$refs.form.validate((valid, obj) => {
+          let is = false;
+          this.form.datasource.forEach((item) => {
+            if (Number(item.totalCount) > item.orderTotalCount) {
+              is = true;
+            }
+          });
+          if (is) {
+            this.$message.warning('发货数量大于订单总数量');
+            if (this.isTotalCount == 1) {
+              callback(false);
+            }
+          }
+          if (obj) {
+            let messages = Object.keys(obj).map((key) => obj[key][0]);
+            if (messages.length > 0) {
+              this.$message.warning(messages[0].message);
+            }
+          }
+
+          callback(valid);
+        });
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      padding-right: 30px;
+    }
+  }
+
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
+
+  ::v-deep .period {
+    display: flex;
+
+    .borderleftnone {
+      .el-input--medium .el-input__inner {
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+      }
+    }
+
+    .borderrightnone {
+      .el-input--medium .el-input__inner {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+      }
+    }
+  }
+
+  ::v-deep .time-form tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
+
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
+
+  .pricebox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    font-weight: bold;
+  }
+</style>

+ 8 - 2
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -81,6 +81,9 @@
       },
       isTotalCount: {
         default: 0
+      },
+      isBoundContract: {
+        default: 0
       }
     },
     data() {
@@ -212,7 +215,7 @@
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.inventoryQuantity>0 ? '有库存' : '无库存';
+              return _row.inventoryQuantity > 0 ? '有库存' : '无库存';
             }
           },
           {
@@ -278,13 +281,16 @@
           where['currentUserId'] = this.user.info.userId;
           orderStatus = '';
         }
+        if (this.isBoundContract) {
+          where['isBoundContract'] = this.isBoundContract;
+        }
         return getTableList({
           pageNum: page,
           size: limit,
           ...where,
           orderStatus,
           ...this.searchParams,
-          isNoSendDone:this.isTotalCount
+          isNoSendDone: this.isTotalCount
         });
       },
 

+ 38 - 32
src/views/saleManage/saleOrder/invoice/components/print-template-jr.vue

@@ -18,15 +18,15 @@
             width: 100%;
             font-size: 12px;
             display: flex;
-            margin-bottom: 15px;
+            margin-bottom: 3px;
           "
         >
-          <span style="width: 48%">
-            <span style="width: 60px; display: inline-block"></span>
+          <span style="width: 40%">
+            <span style="width: 100px; display: inline-block"></span>
             {{ formData.contactName }}
           </span>
           <span>
-            <span style="width: 60px; display: inline-block"></span>
+            <span style="width: 100px; display: inline-block"></span>
             {{ formData.docNo }} {{ page.length + '/' + (index + 1) }}
           </span>
         </div>
@@ -38,20 +38,20 @@
             margin-bottom: 15px;
           "
         >
-          <span style="width: 48%">
+          <span style="width: 45%">
             <span style="width: 170px; display: inline-block"></span>
             湖南聚仁中药饮片有限公司
           </span>
-          <span style="width: 17%">
-            <span style="width: 60px; display: inline-block"></span>
+          <span style="width: 25%">
+            <span style="width: 80px; display: inline-block"></span>
             {{ formData?.productList[0]?.warehouseName }}
           </span>
           <span style="width: 17%">
-            <span style="width: 60px; display: inline-block"></span>
-            {{ formData.createTime }}
+            <span style="width: 80px; display: inline-block"></span>
+            {{ formData.createTime.split(' ')[0] }}
           </span>
-          <span style="width: 17%">
-            <span style="width: 60px; display: inline-block"></span>
+          <span>
+            <span style="width: 130px; display: inline-block"></span>
             ¥{{ formData.totalPrice }}
           </span>
         </div>
@@ -59,32 +59,31 @@
           cellspacing="0"
           style="
             width: 100%;
-            height: 240px;
+            /* height: 240px; */
             table-layout: fixed;
             word-break: break-all;
-            word-wrap: break-word;
-            font-size: 12px;
+            word-wrap: break-word;margin-left: 10px;font-size: 12px;
           "
         >
           <tbody>
-            <tr align="center" style="height: 35px">
-              <td style="width: 6%"> </td>
-              <td style="width: 6%"> </td>
-              <td style="width: 6%"> </td>
+            <tr align="center" style="height: 28px">
+              <td style="width: 8%"> </td>
+              <td style="width: 8%"> </td>
               <td style="width: 6%"> </td>
-              <td style="width: 3%"> </td>
+              <td style="width:8%"> </td>
+              <td style="width: 4%"> </td>
+              <td style="width: 5.5%"> </td>
               <td style="width: 6%"> </td>
               <td style="width: 7%"> </td>
-              <td style="width: 7%"> </td>
               <td style="width: 8%"> </td>
               <td style="width: 8%"> </td>
               <td style="width: 8%"> </td>
               <td> </td>
-              <td> </td>
+              <!-- <td> </td> -->
             </tr>
             <tr
               align="center"
-              style="height: 30px"
+              style="height: 28px"
               v-for="(val, index) in item"
             >
               <td> {{ val.productCode }} </td>
@@ -106,7 +105,7 @@
               <td> {{ val.batchNo }}</td>
               <td> </td>
               <td> {{ val.guaranteePeriodDeadline }}</td>
-              <td> </td>
+              <!-- <td> </td> -->
               <td> {{ val.remark }}</td>
             </tr>
             <tr align="center" style="height: 30px">
@@ -122,7 +121,7 @@
                 ¥{{ getTotalValue('singlePrice', 2) }}
               </td>
               <td :colspan="5">
-                <div style="margin-left: 65px"></div>
+                <div style="margin-left: 35px"></div>
               </td>
             </tr>
           </tbody>
@@ -133,7 +132,7 @@
             font-size: 12px;
             display: flex;
             justify-content: space-between;
-            margin-top: 10px;
+            margin-top: 3x;
           "
         >
           <div style="flex: 1">
@@ -240,6 +239,13 @@
         for (let i = 0; i < array.length; i += size) {
           result.push(array.slice(i, i + size));
         }
+        result.forEach((item) => {
+          if (item.length < 6) {
+            item.push(...new Array(6 - item.length).fill({}));
+          }
+        });
+
+        console.log(result, 'result');
         return result;
       },
       close() {
@@ -321,9 +327,9 @@
         printWindow.document.open();
         printWindow.document.write('<html><head><title>打印预览</title>');
         printWindow.document.write(`<style>
-      @page { size: 310mm 100mm; margin: 0; }  
-    body { font-family: "Courier New"; font-size: 10pt; }  
-    table { width: 300mm; border-collapse: collapse; }  
+
+    body { font-family: "Courier New"; font-size: 9pt; }  
+    table { width:260mm; border-collapse: collapse; }  
 @media print {
   table{
     border:none
@@ -333,12 +339,12 @@
     page-break-inside: avoid !important;
   }
   @page {
-    //  size: 241mm 140mm;
-    // margin: 10mm; /* 去除页边距 */
+     size: 260mm 110mm;
+    margin: 10mm 10mm 10mm 10mm; /* 去除页边距 */
   }
   body {
-    // width: 40cm;
-    // height: 11cm;
+    width: 260mm;
+    height:110mm;
     padding: 0;
     margin: 0;
   }

+ 10 - 0
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -853,6 +853,16 @@
             redressProductList,
             returnOrderList: this.orderOption
           });
+          let productListData = [];
+          data.productList.forEach((item) => {
+            if (!item.totalCount) {
+              productListData.push(item.productName);
+            }
+          });
+          console.log(productListData)
+          if (productListData.length) {
+            return this.$message.error(productListData.toString() + ' 退货数量不能为空!');
+          }
           if (orderIds?.length) {
             commitData.orderIds = Array.from(new Set(orderIds)).toString();
           }

+ 13 - 13
src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

@@ -758,19 +758,19 @@
         // }
         this.$set(this.form.datasource, this.form.datasource.length, obj);
       },
-      validateTotalCount(row) {
-        return (rule, value, callback) => {
-          if (isNaN(value) || Number(value) <= 0) {
-            this.$message.error('请输入大于0的数');
-            callback(new Error('请输入大于0的数字'));
-          } else if (Number(value) > row.sendTotalCount) {
-            this.$message.error('输入的数字不能大于最大发货值');
-            callback(new Error('输入的数字不能大于最大发货值'));
-          } else {
-            callback();
-          }
-        };
-      },
+      // validateTotalCount(row) {
+      //   return (rule, value, callback) => {
+      //     if (isNaN(value) || Number(value) <= 0) {
+      //       this.$message.error('请输入大于0的数');
+      //       callback(new Error('请输入大于0的数字'));
+      //     } else if (Number(value) > row.sendTotalCount) {
+      //       this.$message.error('输入的数字不能大于最大发货值');
+      //       callback(new Error('输入的数字不能大于最大发货值'));
+      //     } else {
+      //       callback();
+      //     }
+      //   };
+      // },
       getTotalCount(row) {
         let num = 0;
         this.form.datasource