ソースを参照

发货单修改

yusheng 1 年間 前
コミット
d1ff18fa67

+ 11 - 9
src/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog.vue

@@ -181,7 +181,6 @@
     addReceiveInformation,
     UpdateReceiveInformation,
     getReceiveSaleOrderrecordDetail,
-    submit
   } from '@/api/purchasingManage/purchaseorderreceive';
   import inventoryTable from './inventoryTable.vue';
   import orderListDialog from './orderListDialog.vue';
@@ -413,6 +412,8 @@
       //获取委外发货单数据回调
       async getOutSourceInfo(row) {
         const data = await getPurchaseOutSourceSendDetailAPI(row.id);
+       let orderData = await getByIdCondition(data.orderId,2);
+ 
         this.$nextTick(() => {
           let {
             carNo,
@@ -421,7 +422,7 @@
             linkPhone,
             orderId,
             orderNo,
-            productList,
+            // productList,
             sendNoteNo,
             supplierId,
             supplierName,
@@ -430,8 +431,9 @@
             pricingWay,
             id
           } = data;
-          if (productList && productList.length > 0) {
-            productList.forEach((v) => {
+          if (orderData.productList && orderData.productList.length > 0) {
+            orderData.productList.forEach((v) => {
+              v.id = '';
               v.orderTotalCount = v.orderTotalCount || v.totalCount;
             });
           }
@@ -444,18 +446,18 @@
             orderId,
             sourceTypeName,
             sourceType,
-            productList,
+            // productList,
             sendNoteNo,
             carNo,
             pricingWay,
             outsourceSendCode: code,
             outsourceSendId: id,
           });
-          productList.forEach((item) => {
-            item.id = '';
-          });
+          // productList.forEach((item) => {
+          //   item.id = '';
+          // });
           this.$refs.inventoryTableref &&
-            this.$refs.inventoryTableref.putTableValue(productList, code);
+            this.$refs.inventoryTableref.putTableValue(orderData.productList, code);
         });
       },
       //打开新增编辑弹框

+ 7 - 20
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -56,24 +56,10 @@
         
               <fileMain v-model="form.receiveFiles" type="view"></fileMain>
             </el-form-item>
-            <el-form-item label="质检回执:" prop="qualityReportFiles">
-              <div
-                v-if="
-                  detailData.qualityReportFiles &&
-                  detailData.qualityReportFiles?.length
-                "
-              >
-                <el-link
-                  v-for="link in detailData.qualityReportFiles"
-                  :key="link.id"
-                  type="primary"
-                  :underline="false"
-                  @click="downloadFile(link)"
-                >
-                  {{ link.name }}</el-link
-                >
-              </div>
-            </el-form-item>
+            <!-- <el-form-item label="质检回执:" prop="qualityReportFiles">
+              <fileMain v-model="form.qualityReportFiles" type="view"></fileMain>
+
+            </el-form-item> -->
           </el-col>
 
           <el-col :span="8">
@@ -105,14 +91,14 @@
               </el-select>
             </el-form-item>
         
-            <el-form-item v-if="form.reviewStatus == 2" label="入库单:">
+            <!-- <el-form-item v-if="form.reviewStatus == 2" label="入库单:">
               <el-link
                 type="primary"
                 :underline="false"
                 @click="handleInnerBound"
                 >点击查看入库单</el-link
               >
-            </el-form-item>
+            </el-form-item> -->
           </el-col>
 
           <el-col :span="8">
@@ -568,6 +554,7 @@
     methods: {
       async open(row) {
         this.form = row;
+        this.activeComp='main'
         this.visible = true;
         this.getDetailData(row.id);
         this.detailId = row.id;

+ 45 - 2
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -179,6 +179,26 @@
           </template>
         </el-popconfirm>
       </template>
+      <template v-slot:taskName="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.taskName'"
+        >
+          <el-input
+            v-model="scope.row.taskName"
+            placeholder="请选择"
+            style="width: 60%; margin-right: 10px"
+            disabled
+          ></el-input>
+          <el-button
+            v-if="scope.row.productCode"
+            size="small"
+            type="primary"
+            @click.native="handleTaskinstance(scope.row, scope.$index)"
+            >选择
+          </el-button>
+        </el-form-item>
+      </template>
     </ele-pro-table>
     <product-list
       ref="productListRef"
@@ -194,6 +214,12 @@
       :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
       @saveDate="saveDate"
     ></outbound-details-dialog>
+    <taskinstance-dialog
+      ref="taskinstanceDialogRef"
+      v-if="taskinstanceDialogFlag"
+      @saveTaskInstance="saveTaskInstance"
+      :visible.sync="taskinstanceDialogFlag"
+    ></taskinstance-dialog>
   </el-form>
 </template>
 <script>
@@ -208,6 +234,7 @@
   import outboundDetailsDialog from './outboundDetailsDialog.vue';
   import { getOutInBySourceBizNoAPI } from '@/api/saleManage/returnGoods';
   import fileMain from '@/components/addDoc/index.vue';
+  import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
 
   export default {
     mixins: [dictMixins],
@@ -221,7 +248,7 @@
     components: {
       fileMain,
       outboundDetailsDialog,
-      productList
+      productList,taskinstanceDialog
     },
     data() {
       const defaultForm = {
@@ -240,6 +267,7 @@
         discountTotalPrice: 0.0,
         allPrice: 0.0,
         outboundDetailsDialogFlag: false,
+        taskinstanceDialogFlag:false,
         curIndex: undefined,
         numberReg,
         defaultForm,
@@ -280,7 +308,7 @@
             align: 'center'
           },
           {
-            minWidth: 150,
+            minWidth: 240,
             prop: 'taskName',
             label: '工序',
             slot: 'taskName',
@@ -601,6 +629,21 @@
         this.$set(this.form.datasource[index], 'warehouseCode', data.code);
         this.$set(this.form.datasource[index], 'warehouseId', data.id);
       },
+      handleTaskinstance(row, index) {
+        this.taskinstanceDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.taskinstanceDialogRef.open(row, index);
+        });
+      },
+      saveTaskInstance(row = {}) {
+        this.$set(this.form.datasource[row.index], 'taskId', row.id);
+        this.$set(this.form.datasource[row.index], 'taskName', row.name);
+        this.$set(
+          this.form.datasource[row.index],
+          'routingId',
+          row.produceRoutingId
+        );
+      },
       //修改发货总重
       changeSendTotalWeight(index) {
         this.curIndex = index;

+ 21 - 1
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -93,6 +93,26 @@
           ></el-input>
         </el-form-item>
       </template>
+      <template v-slot:singlePrice="scope" >
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.singlePrice'"
+          :rules="{
+            required: true,
+            message: '请输入正确的单价',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.singlePrice"
+            placeholder="请输入"
+            @input="changeNum(val, scope.row, scope.$index)"
+            type="number"
+          >
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+      </template>
       <template v-slot:warehouseId="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -377,7 +397,7 @@
             }
           },
           {
-            width: 80,
+            width: 190,
             prop: 'singlePrice',
             label: '单价',
             slot: 'singlePrice',

+ 64 - 35
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -67,15 +67,11 @@
             <el-radio v-model="form.needProduce" :label="2"
               >无客户生产性订单</el-radio
             >
+            <el-radio v-model="form.needProduce" :label="3">不定项订单</el-radio>
           </el-form-item>
           <el-form-item prop="orderFiles" label="订单附件">
             <fileMain v-model="form.orderFiles"></fileMain>
-            <!--            <fileUpload-->
-            <!--              v-model="form.orderFiles"-->
-            <!--              module="main"-->
-            <!--              :showLib="false"-->
-            <!--              :limit="10"-->
-            <!--            />-->
+
           </el-form-item>
         </el-col>
 
@@ -114,6 +110,18 @@
             >
             </DictSelection>
           </el-form-item>
+          <el-form-item label="总数" prop="totalPlanNum" v-if="form.needProduce==3">
+            <el-input v-model="form.totalPlanNum" class="totalPlanNum">
+              <template slot="append">
+                <DictSelection
+                  dictName="计量单位"
+                  clearable
+                  v-model="form.planNumUnit"
+                >
+                </DictSelection>
+              </template>
+            </el-input>
+          </el-form-item>
           <!-- <el-form-item label="计价方式" prop="pricingWay">
             <el-radio-group
               v-model="form.pricingWay"
@@ -267,16 +275,21 @@
         </el-col>
       </el-row>
 
-      <headerTitle title="物品清单" style="margin-top: 30px"></headerTitle>
+      <headerTitle
+        title="物品清单"
+        style="margin-top: 30px"
+        v-if="form.needProduce != 3"
+      ></headerTitle>
       <inventoryTable
+        v-if="form.needProduce != 3"
         :customerMark="customerMark"
-        :isCustomerMark="clientEnvironmentId!=4"
+        :isCustomerMark="clientEnvironmentId != 4"
         :isProduceDeliveryDeadline="form.needProduce != 0"
         ref="inventoryTable"
         @setCountAmount="setCountAmount"
         :isContractId="!!form.contractId"
         :isChangeCount="false"
-        :needProduce="needProduce"
+        :needProduce="form.needProduce"
       ></inventoryTable>
       <!--        @change="handleChange"-->
       <el-row v-if="form.needProduce == 1">
@@ -395,7 +408,7 @@
 </template>
 
 <script>
-  import { emailReg, numberReg,telReg } from 'ele-admin';
+  import { emailReg, numberReg, telReg } from 'ele-admin';
   import { acceptUnpackoptions } from '@/enum/dict';
   import inventoryTable from '@/BIZComponents/inventoryTable.vue';
   import fileUpload from '@/components/upload/fileUpload';
@@ -428,7 +441,7 @@
   import fileMain from '@/components/addDoc/index.vue';
   import modalTitle from '@/BIZComponents/modalTitle.vue';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
-  import {getUserDetail} from '@/api/system/organization/index.js';
+  import { getUserDetail } from '@/api/system/organization/index.js';
   export default {
     mixins: [dictMixins],
     components: {
@@ -491,7 +504,8 @@
         partbLinkName: '',
         partbName: '',
         partbTel: '',
-        needProduce: 1
+        needProduce: 1,
+        planNumUnit: '立方'
       };
 
       return {
@@ -751,8 +765,10 @@
       //选择客户回调
       async changeParent(obj, isCustomerMark) {
         const { base, other } = await contactDetail(obj.id);
-        const userInfo=base?.salesmanId?await getUserDetail(base.salesmanId):{}
-  
+        const userInfo = base?.salesmanId
+          ? await getUserDetail(base.salesmanId)
+          : {};
+
         this.customerMark = base.serialNo;
         if (isCustomerMark) {
           return;
@@ -767,10 +783,9 @@
           partaTel: '',
           partaUnifiedSocialCreditCode: base.unifiedSocialCreditCode,
           customerMark: base.serialNo,
-          receiveAddress: other.addressName + other.address,
-      
+          receiveAddress: other.addressName + other.address
         });
-        this.changePersonel(userInfo?.id?userInfo:'')
+        this.changePersonel(userInfo?.id ? userInfo : '');
 
         await this.getLinkInfo(obj.id);
         this.$nextTick(() => {
@@ -821,7 +836,7 @@
         this.form = Object.assign({}, this.form, {
           projectName: obj.name,
           projectId: obj.id,
-          projectCode: obj.code,
+          projectCode: obj.code
         });
 
         if (obj.contractId) {
@@ -965,7 +980,7 @@
       },
 
       getValidate() {
-        return Promise.all([
+        let arr = [
           new Promise((resolve, reject) => {
             this.$refs.form.validate((valid) => {
               if (!valid) {
@@ -974,41 +989,50 @@
                 resolve(true);
               }
             });
-          }),
-          new Promise((resolve, reject) => {
-            this.$refs.inventoryTable.validateForm((valid) => {
-              if (!valid) {
-                reject(false);
-              } else {
-                resolve(true);
-              }
-            });
           })
-        ]);
+        ];
+        if (this.form.needProduce != 3) {
+          arr.push(
+            new Promise((resolve, reject) => {
+              this.$refs.inventoryTable.validateForm((valid) => {
+                if (!valid) {
+                  reject(false);
+                } else {
+                  resolve(true);
+                }
+              });
+            })
+          );
+        }
+
+        return Promise.all(arr);
       },
       async save(type) {
         try {
           await this.getValidate();
           // 表单验证通过,执行保存操作
           this.loading = true;
-          let isTemporary = []
+          let isTemporary = [];
 
           if (!this.isUpdate) {
             delete this.form.id;
           }
 
           let commitData = Object.assign({}, this.form, {
-            productList: this.$refs.inventoryTable.getTableValue(),
+            productList: this.$refs?.inventoryTable?.getTableValue()||[],
             saleTypeName: this.getDictValue('销售类型', this.form.saleType)
           });
           commitData.productList.forEach((item) => {
             if (!item.productCode) {
-              isTemporary.push(item.productName)
+              isTemporary.push(item.productName);
             }
           });
-          if (isTemporary.length>0) {
-            this.$message.error(isTemporary.toString()+'是临时产品,无法创建订单,请先去主数据维护!');
-            
+          if (isTemporary.length > 0) {
+            this.$message.error(
+              isTemporary.toString() +
+                '是临时产品,无法创建订单,请先去主数据维护!'
+            );
+
             return;
           }
           this.interfaceCall(commitData, type);
@@ -1118,4 +1142,9 @@
     font-size: 16px;
     padding-right: 30px;
   }
+  .totalPlanNum {
+    :deep(.el-input-group__append) {
+      width: 160px;
+    }
+  }
 </style>

+ 57 - 75
src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue

@@ -23,29 +23,12 @@
             <el-input type="textarea" v-model="form.remark" disabled></el-input>
           </el-form-item>
           <el-form-item prop="orderFiles" label="订单附件:">
-            <div v-if="form.orderFiles && form.orderFiles?.length">
-              <el-link
-                v-for="link in form.orderFiles"
-                :key="link.id"
-                type="primary"
-                :underline="false"
-                @click="downloadFile(link)"
-              >
-                {{ link.name }}</el-link
-              >
-            </div>
+            <fileMain v-model="form.orderFiles" type="view"></fileMain>
           </el-form-item>
         </el-col>
 
         <el-col :span="12">
-          <!-- <el-form-item
-              label="交货日期:"
-              prop="deliveryDate"
-
-            >
-              {{ form.deliveryDate }}
-            </el-form-item> -->
-
+     
           <el-form-item label="项目名称:" prop="projectName">
             <el-input v-model="form.projectName" disabled></el-input>
           </el-form-item>
@@ -65,16 +48,9 @@
               <template slot="append"> 元 </template>
             </el-input>
           </el-form-item>
-          <!-- <el-form-item label="计价方式:">
-            <el-radio v-model="form.pricingWay" disabled :label="1"
-              >按数量计费</el-radio
-            >
-            <el-radio v-model="form.pricingWay" disabled :label="2"
-              >按重量计费</el-radio
-            >
-          </el-form-item> -->
+       
           <el-form-item
-            label="订单类型"
+            label="订单类型"
             prop="needProduce"
             style="margin-bottom: 22px"
           >
@@ -84,6 +60,22 @@
             <el-radio v-model="form.needProduce" disabled :label="0"
               >库存式订单</el-radio
             >
+            <el-radio v-model="form.needProduce" disabled :label="2"
+              >无客户生产性订单</el-radio
+            >
+            <el-radio v-model="form.needProduce" disabled :label="3">不定项订单</el-radio>
+          </el-form-item>
+          <el-form-item label="总数" prop="totalPlanNum" v-if="form.needProduce==3">
+            <el-input v-model="form.totalPlanNum" class="totalPlanNum" disabled>
+              <template slot="append">
+                <DictSelection
+                  dictName="计量单位"
+                  disabled
+                  v-model="form.planNumUnit"
+                >
+                </DictSelection>
+              </template>
+            </el-input>
           </el-form-item>
         </el-col>
       </el-row>
@@ -118,19 +110,9 @@
             <el-input v-model="form.partaAddress" disabled></el-input>
           </el-form-item>
           <el-form-item label="创建人:" prop="createUsername">
-          <el-input v-model="form.createUsername" disabled></el-input>
-        </el-form-item>
-          <!-- <el-form-item
-              label="客户税号"
-              prop="contactAddress"
+            <el-input v-model="form.createUsername" disabled></el-input>
+          </el-form-item>
 
-            >
-              <el-input
-                clearable
-                v-model="form.contactAddress"
-                placeholder="请输入"
-              />
-            </el-form-item> -->
         </el-col>
 
         <el-col :span="12">
@@ -168,10 +150,10 @@
           <el-form-item label="售出方地址:" prop="partbAddress">
             <el-input v-model="form.partbAddress" disabled></el-input>
           </el-form-item>
-  
-      <el-form-item label="创建时间:" prop="createTime">
-          <el-input v-model="form.createTime" disabled></el-input>
-        </el-form-item>
+
+          <el-form-item label="创建时间:" prop="createTime">
+            <el-input v-model="form.createTime" disabled></el-input>
+          </el-form-item>
         </el-col>
       </el-row>
     </el-form>
@@ -180,45 +162,45 @@
     <inventoryTabledetail
       ref="inventoryTabledetailRef"
       :isCustomerMark="true"
-        :isDiscountTotalPrice="true"
-        pageName="send"
+      :isDiscountTotalPrice="true"
+      pageName="send"
     ></inventoryTabledetail>
   </div>
 </template>
 
 <script>
-import { getFile } from '@/api/system/file';
-import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
+  import { getFile } from '@/api/system/file';
+  import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
+  import fileMain from '@/components/addDoc/index.vue';
 
-import dictMixins from '@/mixins/dictMixins';
-export default {
-  mixins: [dictMixins],
-  components: { inventoryTabledetail },
-  data() {
-    return {
-      form: {}
-    };
-  },
-  methods: {
-    async init(row) {
-      this.form = row;
-      this.$nextTick(() => {
-        this.$refs.inventoryTabledetailRef &&
-          this.$refs.inventoryTabledetailRef.putTableValue(row);
-      });
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    components: { inventoryTabledetail,fileMain },
+    data() {
+      return {
+        form: {}
+      };
     },
+    methods: {
+      async init(row) {
+        this.form = row;
+        this.$nextTick(() => {
+          this.$refs.inventoryTabledetailRef &&
+            this.$refs.inventoryTabledetailRef.putTableValue(row);
+        });
+      },
 
-    downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-// :deep(.el-input) {
-//   width: 70%;
-// }
-// :deep(.el-textarea) {
-//   width: 70%;
-// }
-</style>
+  .totalPlanNum {
+    :deep(.el-input-group__append) {
+      width: 160px;
+    }
+  }
+</style>

+ 4 - 0
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -122,6 +122,7 @@
           ref="inventoryTableref"
           :orderId="form.orderId"
           @replaceTableChange="replaceTableChange"
+          :needProduce="saleOrderValue.needProduce"
         ></inventoryTable>
       </el-tab-pane>
       <el-tab-pane label="托盘清单" name="second">
@@ -272,6 +273,7 @@
 
       return {
         fullscreen: false,
+        saleOrderValue:{},
         detailData: {},
         payWayOptions: [],
         delDetailIds: [],
@@ -333,6 +335,7 @@
       async getSaleOrderDetail(id) {
         this.loading = true;
         const data = await getSaleOrderDetail(id);
+        this.saleOrderValue=data
         this.loading = false;
         this.partbAddress = data.partbAddress;
         if (data) {
@@ -423,6 +426,7 @@
         this.loading = true;
         const data = await getSendSaleOrderrecordDetailSplit(id);
         this.partbAddress = data.saleOrder.partbAddress;
+        this.saleOrderValue=data.saleOrder
 
         this.loading = false;
         if (data) {

+ 4 - 1
src/views/saleManage/saleOrder/invoice/components/detailDialog.vue

@@ -290,6 +290,9 @@
       this.requestDict('生产类型');
     },
     computed: {
+      // clientEnvironmentId() {
+      //   return this.$store.state.user.info.clientEnvironmentId;
+      // },
       competAnalysisListcolumns() {
         return [
         {
@@ -432,7 +435,7 @@
             label: '发货块数',
             slot: 'blockCount',
             align: 'center',
-            show: this.clientEnvironmentId == '4'
+            // show: this.clientEnvironmentId == '4'
           },
           {
             width: 120,

+ 150 - 59
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -13,7 +13,7 @@
       <template v-slot:toolbar>
         <div class="headbox">
           <el-button
-            v-if="isShowAdd"
+            v-if="isShowAdd && needProduce != 3"
             size="small"
             type="primary"
             icon="el-icon-plus"
@@ -22,22 +22,21 @@
           >
             新增
           </el-button>
+          <el-button
+            v-if="isShowAdd && needProduce == 3"
+            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>
-          <!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
-          <!--            <el-link-->
-          <!--              v-for="link in row.technicalDrawings"-->
-          <!--              :key="link.id"-->
-          <!--              type="primary"-->
-          <!--              :underline="false"-->
-          <!--              @click="download(link)"-->
-          <!--            >-->
-          <!--              {{ link.name }}-->
-          <!--            </el-link>-->
-          <!--          </div>-->
         </el-form-item>
       </template>
       <template v-slot:remark="{ row, $index }">
@@ -129,7 +128,7 @@
         >
           <el-input
             v-model="scope.row.totalCount"
-            @input="(val) => changeCount(scope.row, scope.$index)"
+            @input="(val) => changeCount1(scope.row, scope.$index)"
           ></el-input>
         </el-form-item>
       </template>
@@ -156,7 +155,6 @@
         <el-form-item
           :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
         >
-          <!-- :disabled="!entrustedCode"         -->
           <el-input-number
             :controls="false"
             v-model="scope.row.receiveTotalWeight"
@@ -197,11 +195,13 @@
         </el-form-item>
       </template>
       <template v-slot:warehouseId="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.warehouseId'"   :rules="[{ required: true, message: '请选择仓库', trigger: 'blur' }]">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.warehouseId'"
+          :rules="[{ required: true, message: '请选择仓库', trigger: 'blur' }]"
+        >
           <el-select
             v-model="scope.row.warehouseId"
             placeholder="请选择"
-          
             @change="warehouseChange(scope.$index, scope.row)"
           >
             <el-option
@@ -214,15 +214,44 @@
           </el-select>
         </el-form-item>
       </template>
-      <!-- <template v-slot:warehouseNum="scope">
+
+      <template v-slot:singlePrice="scope" >
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.singlePrice'"
+          :rules="{
+            required: true,
+            message: '请输入正确的单价',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.singlePrice"
+            placeholder="请输入"
+            @input="changeCount"
+            type="number"
+          >
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:singleWeight="scope" v-if="needProduce == 3">
         <el-form-item
-          :prop="'datasource.' + scope.$index + '.warehouseNum'"
-          :rules="[{ required: true, message: '库存不足', trigger: 'blur' }]"
+          style="margin-bottom: 20px"
+          :rules="{
+            required: false,
+            pattern: numberReg,
+            trigger: 'change'
+          }"
+          :prop="'datasource.' + scope.$index + '.singleWeight'"
         >
-          <el-input v-model="scope.row.warehouseNum" readonly> </el-input>
+          <el-input
+            :disabled="isContractId"
+            v-model="scope.row.singleWeight"
+            placeholder="请输入"
+          ></el-input>
         </el-form-item>
-      </template> -->
-
+      </template>
       <template v-slot:headerWarehouseNum="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -232,8 +261,8 @@
       <template v-slot:headerTotalCount="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
-      
-      <template v-slot:receiveTotalWeight="{ column }">
+
+      <template v-slot:headerReceiveTotalWeight="{ column }">
         <span :class="{ 'is-required': entrustedCode && pricingWay == 2 }">{{
           column.label
         }}</span>
@@ -285,6 +314,12 @@
       ref="selectStockLedgerDialogRef"
       @changeParent="replaceTable"
     ></selectStockLedgerDialog>
+    <BIZproductList
+      ref="BIZproductListRef"
+      classType="1"
+      :isGetInventoryTotal="true"
+      @changeParent="changeParentBiz"
+    ></BIZproductList>
   </el-form>
 </template>
 <script>
@@ -305,11 +340,14 @@
   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 { changeCount } from '@/BIZComponents/setProduct.js';
   export default {
     mixins: [dictMixins, getDynamicsColumns],
     props: {
       orderId: String,
+      needProduce: String,
       entrustedCode: String,
       pricingWay: [String, Number],
       isShowAdd: {
@@ -322,7 +360,8 @@
       innertboundDetailsDialog,
       productList,
       stockLedgerDialog,
-      selectStockLedgerDialog
+      selectStockLedgerDialog,
+      BIZproductList
     },
     data() {
       const defaultForm = {
@@ -504,8 +543,7 @@
             prop: 'warehouseNum',
             label: '库存',
             align: 'center',
-            slot: 'warehouseNum',
-
+            slot: 'warehouseNum'
           },
 
           // {
@@ -545,7 +583,7 @@
             label: '发货块数',
             slot: 'blockCount',
             align: 'center',
-            show: this.clientEnvironmentId == '4'
+            // show: this.clientEnvironmentId == '4'
           },
           {
             width: 120,
@@ -610,9 +648,7 @@
             prop: 'taxRate',
             label: '税率',
             formatter: (_row, _column, cellValue) => {
-              return _row.taxRate
-                ? _row.taxRate+'%'
-                : '';
+              return _row.taxRate ? _row.taxRate + '%' : '';
             },
             align: 'center'
           },
@@ -651,9 +687,14 @@
             label: '质保期',
             slot: 'guaranteePeriod',
             formatter: (_row, _column, cellValue) => {
-              return (
-                (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
-              );
+              let val = '';
+              if (_row.guaranteePeriod) {
+                val += _row.guaranteePeriod;
+              }
+              if (_row.guaranteePeriodUnitName) {
+                val += _row.guaranteePeriodUnitName;
+              }
+              return val
             },
             align: 'center'
           },
@@ -734,6 +775,10 @@
           this.$refs.stockLedgerDialogRef.init(row.sendProductDetail, row);
         });
       },
+      changeCount1(row, index) {
+        this.tableHandleKeyUp(row, index,'sum');
+        this.changeCount();
+      },
       //改变数量
       changeCount() {
         this.form.datasource.forEach((item, index) => {
@@ -753,12 +798,14 @@
             this.$set(
               this.form.datasource[index],
               'discountTotalPrice',
-              item.discountSinglePrice * item.totalCount*(item.singleWeight||0)
+              item.discountSinglePrice *
+                item.totalCount *
+                (item.singleWeight || 0)
             );
             this.$set(
               this.form.datasource[index],
               'totalPrice',
-              item.singlePrice * item.totalCount*(item.singleWeight||0)
+              item.singlePrice * item.totalCount * (item.singleWeight || 0)
             );
           }
         });
@@ -881,9 +928,7 @@
 
       // 表格:模数、数量(方)、块数输入框 输入事件
       tableHandleKeyUp(row, index, name) {
-        console.log(row, 'row');
-        // && this.clientEnvironmentId == '4'
-        if (row.specification && this.clientEnvironmentId == '4') {
+        if (row.specification) {
           let modelArr = row.specification.split('*');
           let modelLong = modelArr[0]; // model规格长度
           let modeWide = modelArr[1]; // model规格宽度
@@ -897,7 +942,7 @@
             row.totalCount =
               (Number(row.blockCount) * modelLong * modeWide * modeHight) /
               1000000;
-            this.changeCount(row, index);
+            this.changeCount();
           }
         }
       },
@@ -913,6 +958,65 @@
           copyObj(obj)
         );
       },
+      //选择产品回调
+      changeParentBiz(obj = [], idx) {
+        obj.forEach(async (item, index) => {
+          let i = idx == -1 ? index : idx;
+          let row = JSON.parse(JSON.stringify(this.defaultForm));
+          row.key = this.form.datasource.length + 1;
+          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, 'receiveTotalWeight', 0);
+          this.$set(parasm, 'sendTotalWeight', 0);
+          this.$set(parasm, 'increaseTotalWeight', 0);
+
+          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) {
+            this.form.datasource.push(row);
+          }
+        });
+      },
       replaceTable(list) {
         list.forEach((item) => {
           item['relationId'] = this.current.tempId;
@@ -1001,29 +1105,11 @@
                 item.increaseTotalWeight =
                   item.increaseTotalWeight || item.receiveTotalWeight || 0;
               }
-              this.changeCount(item, index);
             });
+            this.changeCount();
           });
         }
       },
-      //选择产品
-      handParent(row, index) {
-        let item = {
-          id: row.productCode
-        };
-        this.$refs.productListRef.open(item, index);
-      },
-      //选择技术人回调
-      changeAnswer(obj, idx) {
-        this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
-        this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
-      },
-      handHead(row, index) {
-        let item = {
-          id: row.technicalAnswerId
-        };
-        this.$refs.headRef.open(item, index);
-      },
 
       remove(i) {
         this.form.datasource.splice(i, 1);
@@ -1039,6 +1125,11 @@
           n.key = index + 1;
         });
       },
+      //选择产品
+      handParent() {
+        if (!this.orderId) return this.$message.error('请先选择订单');
+        this.$refs.BIZproductListRef.open('', -1);
+      },
       // 添加
       handlAdd() {
         if (!this.orderId) return this.$message.error('请先选择订单');

+ 1 - 3
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -195,9 +195,7 @@
     methods: {
       open(item, currentIndex, isAcc = false) {
         this.currentIndex = currentIndex;
-        if (item && item.id) {
-          this.radio = item.id;
-        }
+
         this.isAcc = isAcc;
         this.visible = true;
       },

+ 0 - 0
src/views/saleManage/saleOrder/invoice/components/print-template.vue → src/views/saleManage/saleOrder/invoice/components/print-template-by.vue


+ 171 - 0
src/views/saleManage/saleOrder/invoice/components/print-template-js.vue

@@ -0,0 +1,171 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <div>
+        <div
+          style="
+            border-bottom: solid 1px #000;
+            font-size: 20px;
+            font-weight: 800;
+            padding-right: 20px;
+            width: 400px;
+            margin: 0 auto;
+          "
+          >嘉实(湖南)医院科技有限公司出库单</div
+        >
+        <div style="text-align: center"
+          >(文件编号:JS/SPM-GY-005-01(A/O))</div
+        >
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span style="width: 70%">客户地址:{{ formData.receiveAddress }}</span>
+        <span style="width: 30%">NO.:{{ formData.docNo }}</span>
+      </div>
+      <table
+        cellspacing="0"
+        border
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+          font-size: 12px;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td style="padding: 5px"> 编号 </td>
+            <td style="padding: 5px"> 商品名称 </td>
+            <td style="padding: 5px"> 规格/型号 </td>
+            <td style="padding: 5px"> 生产厂家</td>
+            <td style="padding: 5px"> 数量</td>
+            <td style="padding: 5px"> 单位</td>
+            <td style="padding: 5px"> 批号</td>
+            <td style="padding: 5px"> 序列号</td>
+            <td style="padding: 5px"> 备注</td>
+          </tr>
+
+          <tr align="center" v-for="(item, index) in formData.productList">
+            <td style="padding: 5px"> {{ index + 1 }} </td>
+            <td style="padding: 5px"> {{ item.productName }} </td>
+            <td style="padding: 5px">
+              {{ item.packingSpecification }}/{{ item.modelType }}
+            </td>
+            <td style="padding: 5px"> 嘉实(湖南)医院科技有限公司</td>
+            <td style="padding: 5px"> {{ item.totalCount }}</td>
+            <td style="padding: 5px"> {{ item.measuringUnit }}</td>
+            <td style="padding: 5px"> {{ item.batchNo }}</td>
+            <td style="padding: 5px"> 序列号</td>
+            <td style="padding: 5px"> {{ item.productCode }}</td>
+          </tr>
+          <tr>
+            <td style="padding: 5px" colspan="9">
+              备注: &nbsp;白色仓库联&nbsp;&nbsp;&nbsp;
+              红色客户联&nbsp;&nbsp;&nbsp; 黄色财务联</td
+            >
+          </tr>
+        </tbody>
+      </table>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-top: 10px;
+        "
+      >
+        <div style="flex: 1">
+          <div>编单人/日期:{{ formData.makerName }}</div>
+          <div>{{ formData.createTime }}</div>
+        </div>
+        <div style="flex: 1">
+          <div>审核人/日期:</div>
+          <div>12</div>
+        </div>
+        <div style="flex: 1">
+          收货人:{{ formData.linkName }} {{ formData.linkPhone }}
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
+
+  import { mapGetters } from 'vuex';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    props: {},
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        isPrintPrice: false,
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        getSendSaleOrderrecordDetailSplit(id).then((data) => {
+          this.formData = data;
+          this.QRvisible = true;
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 180 - 0
src/views/saleManage/saleOrder/invoice/components/print-template-jsyp.vue

@@ -0,0 +1,180 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <div>
+        <div
+          style="
+            font-size: 20px;
+            font-weight: 800;
+            padding-right: 20px;
+            width: 400px;
+            margin: 0 auto;
+          "
+          >嘉实(湖南)医药科技有限公司产品出库单</div
+        >
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span style="width:39%">制单日期:{{ formData.receiveAddress }}</span>
+        <span style="width:39%">发货日期:{{ formData.docNo }}</span>
+        <span style="width:22%">出库单号:{{ formData.docNo }}</span>
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span style="width: 70%">客户地址:{{ formData.receiveAddress }}</span>
+        <span style="width: 30%">NO.:{{ formData.docNo }}</span>
+      </div>
+      <table
+        cellspacing="0"
+        border
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+          font-size: 12px;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td style="padding: 5px"> 编号 </td>
+            <td style="padding: 5px"> 商品名称 </td>
+            <td style="padding: 5px"> 规格/型号 </td>
+            <td style="padding: 5px"> 生产厂家</td>
+            <td style="padding: 5px"> 数量</td>
+            <td style="padding: 5px"> 单位</td>
+            <td style="padding: 5px"> 批号</td>
+            <td style="padding: 5px"> 序列号</td>
+            <td style="padding: 5px"> 备注</td>
+          </tr>
+
+          <tr align="center" v-for="(item, index) in formData.productList">
+            <td style="padding: 5px"> {{ index + 1 }} </td>
+            <td style="padding: 5px"> {{ item.productName }} </td>
+            <td style="padding: 5px">
+              {{ item.packingSpecification }}/{{ item.modelType }}
+            </td>
+            <td style="padding: 5px"> 嘉实(湖南)医院科技有限公司</td>
+            <td style="padding: 5px"> {{ item.totalCount }}</td>
+            <td style="padding: 5px"> {{ item.measuringUnit }}</td>
+            <td style="padding: 5px"> {{ item.batchNo }}</td>
+            <td style="padding: 5px"> 序列号</td>
+            <td style="padding: 5px"> {{ item.productCode }}</td>
+          </tr>
+          <tr>
+            <td style="padding: 5px" colspan="9">
+              备注: &nbsp;白色仓库联&nbsp;&nbsp;&nbsp;
+              红色客户联&nbsp;&nbsp;&nbsp; 黄色财务联</td
+            >
+          </tr>
+        </tbody>
+      </table>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-top: 10px;
+        "
+      >
+        <div style="flex: 1">
+          <div>编单人/日期:{{ formData.makerName }}</div>
+          <div>{{ formData.createTime }}</div>
+        </div>
+        <div style="flex: 1">
+          <div>审核人/日期:</div>
+          <div>12</div>
+        </div>
+        <div style="flex: 1">
+          收货人:{{ formData.linkName }} {{ formData.linkPhone }}
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
+
+  import { mapGetters } from 'vuex';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    props: {},
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        isPrintPrice: false,
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        getSendSaleOrderrecordDetailSplit(id).then((data) => {
+          this.formData = data;
+          this.QRvisible = true;
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 40 - 20
src/views/saleManage/saleOrder/invoice/index.vue

@@ -43,15 +43,25 @@
             >
               批量删除
             </el-button>
-            <el-button
-              size="small"
-              type="primary"
-              class="el-icon-printer"
-              @click="handlePrint"
-              :disabled="selection?.length === 0"
-            >
-              打印发货单
-            </el-button>
+            <el-dropdown trigger="click" :disabled="selection?.length === 0">
+              <el-button type="primary" class="el-icon-printer" size="small">
+                打印<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item
+                  @click.native="handlePrint('printTemplateByRef')"
+                  >发货单模板一</el-dropdown-item
+                >
+                <el-dropdown-item
+                  @click.native="handlePrint('printTemplateJsRef')"
+                  >出库单模板一</el-dropdown-item
+                >
+                <!-- <el-dropdown-item
+                  @click.native="handlePrint('printTemplateJsYpRef')"
+                  >出库单模板二(药品)</el-dropdown-item
+                > -->
+              </el-dropdown-menu>
+            </el-dropdown>
           </template>
 
           <!-- 查看详情列 -->
@@ -159,7 +169,9 @@
       content="是否确定删除?"
       @done="commitBtn"
     />
-    <print-template ref="printTemplateRef"></print-template>
+    <printTemplateBy ref="printTemplateByRef"></printTemplateBy>
+    <printTemplateJs ref="printTemplateJsRef"></printTemplateJs>
+    <printTemplateJsYp ref="printTemplateJsYpRef"></printTemplateJsYp>
     <process-submit-dialog
       :isNotNeedProcess="false"
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
@@ -185,7 +197,9 @@
   import { reviewStatusEnum } from '@/enum/dict';
   import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue';
   import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
-  import printTemplate from '@/views/saleManage/saleOrder/invoice/components/print-template.vue';
+  import printTemplateBy from '@/views/saleManage/saleOrder/invoice/components/print-template-by.vue';
+  import printTemplateJs from '@/views/saleManage/saleOrder/invoice/components/print-template-js.vue';
+  import printTemplateJsYp from '@/views/saleManage/saleOrder/invoice/components/print-template-jsyp.vue';
   import {
     deleteSendInformation,
     getSendTableList,
@@ -196,16 +210,17 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
 
   export default {
-    mixins: [dictMixins,tabMixins],
+    mixins: [dictMixins, tabMixins],
     components: {
       processSubmitDialog,
-      printTemplate,
+      printTemplateBy,
       searchTable,
       popModal,
       addReturnGoodsDialog,
       orderDetailDialog,
       addInvoiceDialog,
-      detailDialog,addInvoiceConfirm
+      detailDialog,
+      addInvoiceConfirm,printTemplateJs,printTemplateJsYp
     },
 
     //客户管理数据
@@ -343,7 +358,7 @@
             fixed: 'right'
           }
         ],
-        cacheKeyUrl:'eos-bfe3d5ea-saleManage-invoice' 
+        cacheKeyUrl: 'eos-bfe3d5ea-saleManage-invoice'
       };
     },
     computed: {},
@@ -381,8 +396,8 @@
         this.$refs.invoiceDialogRef.$refs.form &&
           this.$refs.invoiceDialogRef.$refs.form.clearValidate();
       },
-      creatInvoiceConfirm(row){
-        this.$refs.addInvoiceConfirmRef.open('add', {},row);
+      creatInvoiceConfirm(row) {
+        this.$refs.addInvoiceConfirmRef.open('add', {}, row);
       },
       //批量删除
       allDelBtn() {
@@ -396,7 +411,7 @@
           );
         this.delVisible = true;
       },
-      handlePrint() {
+      handlePrint(ref) {
         if (this.selection.length > 1)
           return this.$message.warning('请选择一条');
         let flag = this.selection.some((item) =>
@@ -404,16 +419,21 @@
         );
         if (!flag)
           return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
+        if (ref != 'printTemplateByRef') {
+          this.$refs[ref].open(this.selection[0].id);
+          return;
+        }
+
         this.$confirm('是否需要打印价格', '提示', {
           type: 'warning',
           cancelButtonText: '否',
           confirmButtonText: '是'
         })
           .then((res) => {
-            this.$refs.printTemplateRef.open(this.selection[0].id, true);
+            this.$refs[ref].open(this.selection[0].id, true);
           })
           .catch((err) => {
-            this.$refs.printTemplateRef.open(this.selection[0].id, false);
+            this.$refs[ref].open(this.selection[0].id, false);
           });
       },
       //删除接口

+ 2 - 1
src/views/saleManage/saleOrder/invoiceConfirm/index.vue

@@ -172,7 +172,7 @@
 
   import invoiceDetailDialog from '@/views/saleManage/saleOrder/invoice/components/detailDialog.vue';
   import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
-  import printTemplate from '@/views/saleManage/saleOrder/invoice/components/print-template.vue';
+  import printTemplate from '@/views/saleManage/saleOrder/invoice/components/print-template-by.vue';
   import {
     deleteSendInformation,
     getSendTableList,
@@ -402,6 +402,7 @@
         );
         if (!flag)
           return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
+
         this.$confirm('是否需要打印价格', '提示', {
           type: 'warning',
           cancelButtonText: '否',