| 
					
				 | 
			
			
				@@ -0,0 +1,551 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <!-- 筛选条件 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <div class="table-page-search-wrapper"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-row :gutter="15"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-col :md="4" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-form-item label="出库仓库" prop="warehouseSn"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" @load="warehouseLoad"></chooseWarehouse> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-col :md="4" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-form-item label="产品编码" prop="productCode"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-input id="salesEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-col :md="4" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-form-item label="产品名称" prop="productName"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-input id="salesEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-col :md="4" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-form-item label="品牌"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <ProductBrand id="salesEdit-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-col :md="4" :sm="24"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-form-item label="产品分类"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="salesEdit-productType"></productTypeAll> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </a-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-col :md="4" :sm="24" style="margin-bottom: 10px;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </a-row> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </a-form> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <a-row :gutter="15"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-col :md="12" :sm="24" style="text-align:left;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <span style="margin-right:5px;">已选{{ selectTotal }}项</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-dropdown> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-menu slot="overlay" @click="handleMenuClick"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-menu-item key="0"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                仓库设置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </a-menu-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-menu-item key="1"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                删除已选项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </a-menu-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-menu-item key="2"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                全部删除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </a-menu-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </a-menu> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              type="link" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              class="button-info" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            > 批量操作 <a-icon type="down" /> </a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-dropdown> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-col :md="12" :sm="24" style="text-align:right;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type="link" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            class="button-info" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @click="openGuideModal=true"><a-icon type="login" /> 导入产品</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type="link" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            class="button-info" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @click="openCpModal=true"><a-icon type="plus" /> 添加产品</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </a-row> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <!-- 总计 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <a-alert type="info" style="margin-bottom: 5px;" banner :showIcon="false"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div slot="message" class="total-bar"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          总款数:<strong>{{ detailData&&(detailData.totalCommonCategory || detailData.totalCommonCategory==0) ? detailData.totalCommonCategory : '--' }}</strong>; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          总数量:<strong>{{ detailData&&(detailData.totalCommonQty || detailData.totalCommonQty==0) ? detailData.totalCommonQty : '--' }}</strong>; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </a-alert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <!-- 已选配件列表 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <s-table 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      class="sTable" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ref="table" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :rowKey="(record) => record.id" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :columns="columns" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :data="loadData" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :row-selection="{ columnWidth: 40 }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      @rowSelection="rowSelectionFun" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      :scroll="{ y: 300 }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      bordered> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 产品编码 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="productCode" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <div style="padding-right: 15px;">{{ text }}</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </a-badge> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <span v-if="!(Number(record.stockQty||0) < Number(record.unpushedQty||0))">{{ text }}</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 产品名称 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="productName" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="ellipsisCon"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-tooltip placement="rightBottom"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <template slot="title"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <span>{{ text }}</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <span class="ellipsisText">{{ text }}</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </a-tooltip> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 销售数量 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="salesNums" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-input-number 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          id="salesEdit-qty" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          v-model="record.qty" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          :precision="0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          :min="1" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          :max="999999" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          placeholder="请输入" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          @blur="e => onCellBlur(e.target.value, record)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          style="width: 100%;" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 当前库存 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="stockQty" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div v-if="record.stockQty || record.stockQty==0"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty||0) - Number(record.stockQty||0) }}</span>)</p> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <p style="margin: 0;" v-else>{{ record.stockQty }}</p> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <span v-else>--</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 出库仓库 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="warehouseBox" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          style="width:100%;"  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          placeholder="请选择仓库" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          v-model="record.warehouseSn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          :showSearch="true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          @change="handleWarehouseBox(record)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          mode="default" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          :filter-option="filterOption"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-select-option v-for="item in warehouseDataList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </a-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 操作 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <template slot="action" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          type="link" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          :loading="delLoading" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          class="button-error" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          @click="handleDel(record)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        >删除</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </s-table> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 添加产品 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <chooseProduct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ref="chooseProduct" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        :openModal="openCpModal" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        :isInster="isInster" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        :buyerSn="detailData&&detailData.buyerSn||''" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        @close="openCpModal=false" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        @addProduct="insterProduct"></chooseProduct> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 导入产品 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: salesBillSn}" @close="closeGuideModel" @ok="hanldeOk" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <!-- 仓库设置 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <setWarehouse :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { commonMixin } from '@/utils/mixin' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { STable, VSelect } from '@/components' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import ImportGuideModal from './importGuideModal.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import setWarehouse from './setWarehouse.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import chooseProduct from './chooseProduct.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import chooseWarehouse from '@/views/common/chooseWarehouse' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import ProductBrand from '@/views/common/productBrand.js' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import productTypeAll from '@/views/common/productTypeAll.js' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { salesModify, salesDetailBySn, salesWriteSubmit, getPromoacActiveList, deleteAll, submitCheck, updateWarehouse } from '@/api/sales' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { salesDetailStockList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, salesDetailDelAll, addPromoGoods, salesBatchInsert } from '@/api/salesDetail' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    name: 'ProductList', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    mixins: [commonMixin], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    components: {  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      STable, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      VSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ImportGuideModal, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      chooseWarehouse, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      setWarehouse, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ProductBrand, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      productTypeAll, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      chooseProduct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    props: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      openModal: { //  弹框显示状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        default: false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      newLoading: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      detailData: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: Object, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        default: function(){return null} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      warehouseSn: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        default: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      salesBillSn: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        type: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        default: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    data () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        spinning: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 加载数据方法 必须为 Promise 对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData: parameter => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.disabled = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.queryParam.salesBillSn = this.salesBillSn || '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return salesDetailStockList(Object.assign(parameter, this.queryParam)).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              data = res.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              const no = (data.pageNo - 1) * data.pageSize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              for (var i = 0; i < data.list.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                data.list[i].no = no + i + 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                data.list[i].qtyBackups = data.list[i].qty 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.disabled = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.dataSource = data.list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        openCpModal: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        openWarehouseModal: false, // 打开仓库设置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        openGuideModal: false, //  导入产品引导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        delLoading: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        chooseDisabled: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        disabled: false, //  查询、重置按钮是否可操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queryParam: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          warehouseSn: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productCode: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productName: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productBrandSn: undefined, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productTypeSn1: '', //  产品一级分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productTypeSn2: '', //  产品二级分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productTypeSn3: '' //  产品三级分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        productType: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        rowSelectionInfo: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        warehouseDataList: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    computed: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      selectTotal () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      columns () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const arr = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '序号', dataIndex: 'no', width: '4%', align: 'center' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center', sorter: true }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          arr.splice(7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return arr 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      filterOption (input, option) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      warehouseLoad(sn,list){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.warehouseDataList = list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 表格选中项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      rowSelectionFun (obj) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.rowSelectionInfo = obj || null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      handleBatchDelAll () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (_this.dataSource.length == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.$message.warning('暂无可删除的已选产品!') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          content: '确认要删除全部已选产品吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            deleteAll({ salesBillSn: _this.salesBillSn }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$refs.promotable.resetCurForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 批量删除已选产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      handleBatchDel () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.$message.warning('请先选择要删除的产品后再进行批量操作!') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const obj = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          obj.push(item.salesBillDetailSn) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          content: '已选产品' + obj.length + '项,确认要批量删除吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            salesDetailBatchDel({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              salesBillSn: _this.salesBillSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              salesBillDetailSnList: obj 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$refs.promotable.resetCurForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 设置单个出库仓库 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      handleWarehouseBox (row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const snArr = [row.salesBillDetailSn] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const ajax_data = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          warehouseSn: row.warehouseSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesBillDetailSnList: snArr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesBillSn: this.salesBillSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.setWarehouseInfo(ajax_data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      chooseWarehouseOk (sn) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const snArr = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        _this.rowSelectionInfo.selectedRows.forEach(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          snArr.push(item.salesBillDetailSn) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const ajax_data = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          warehouseSn: sn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesBillDetailSnList: snArr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesBillSn: _this.salesBillSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        _this.setWarehouseInfo(ajax_data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      setWarehouseInfo (data) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        updateWarehouse(data).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.openWarehouseModal = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$refs.promotable.resetCurForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      //  产品分类  change 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      changeProductType (val, opt) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productTypeSn1 = val[0] ? val[0] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productTypeSn2 = val[1] ? val[1] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productTypeSn3 = val[2] ? val[2] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      handleMenuClick (e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (e.key == 0) { // 仓库设置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$message.warning('请先选择要设置的产品!') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.openWarehouseModal = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (e.key == 1) { // 删除已选项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.handleBatchDel() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.handleBatchDelAll() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 已选产品  blur 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      onCellBlur (val, record) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //  光标移出,值发生改变再调用编辑接口 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (val && val != record.qtyBackups) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesDetailUpdateQty({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            salesBillDetailSn: record.salesBillDetailSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            qty: record.qty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            salesBillSn: _this.salesBillSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$refs.promotable.resetCurForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          record.qty = record.qtyBackups 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      //  重置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      resetSearchForm (flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productCode = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productName = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.warehouseSn = undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productBrandSn = undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productTypeSn1 = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productTypeSn2 = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.queryParam.productTypeSn3 = '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.productType = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$refs.table.refresh(!!flag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 整单删除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      delSalerDetailAll () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          content: '确认要整单删除吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          closable: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.delLoading = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            salesDetailDelAll({ salesBillSn: _this.salesBillSn }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.resetSearchForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$refs.promotable.resetCurForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.delLoading = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 删除产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      handleDel (row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          content: '确认要删除吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          closable: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.delLoading = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$refs.promotable.resetCurForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.delLoading = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 添加产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      insterProduct (row, promotionFlag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.log(row, promotionFlag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 防止多次添加产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (this.isInster) { return } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.saveNewProduct(row, promotionFlag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 保存添加的产品到销售列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      saveNewProduct (row, promotionFlag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$message.loading('正在添加产品...', 1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.isInster = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        salesDetailInsert({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          packQty: row.productPackQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          productSn: row.productSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          showCost: row.lastStockCost, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          price: row.productPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          origPrice: row.productPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          promotionGiftsAmount: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          usePromotionGiftsAmount: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          qty: row.salesNums, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesBillSn: this.detailData.salesBillSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesBillNo: this.detailData.salesBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          purchaseBillSn: this.detailData.purchaseBillSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          purchaseBillNo: this.detailData.purchaseBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          stockSn: row.stockSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          warehouseSn: row.warehouseSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.resetSearchForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$message.success('产品添加成功', 2.5) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.isInster = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).catch(err => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.isInster = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      closeGuideModel () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.openGuideModal = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 导入产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      hanldeOk (obj) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        salesBatchInsert(obj).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.getOrderDetail(false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<style lang="less"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  .total-bar{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    display:flex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    justify-content: space-between; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</style> 
			 |