| 
					
				 | 
			
			
				@@ -3,10 +3,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <a-affix :target="() => this.$refs.container"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <a-page-header 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         :ghost="false" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        @back="() => $router.go(-1)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        @back="handleBack" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        :backIcon="false" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template slot="subTitle"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a href="javascript:;" @click="() => $router.go(-1)">客户名称:{{ ordeDetai&&ordeDetai.buyerName }}</a> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a id="back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName }}</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <!-- <a-button size="small" @click="handleEditCustom" style="margin-left:50px" key="0"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             编辑 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </a-button> --> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -24,42 +26,57 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <a-card size="small" :bordered="false" class="pages-wrap"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <!-- 查询配件列表 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <queryPart :buyerSn="$route.params.buyerSn"></queryPart> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <queryPart :buyerSn="$route.params.buyerSn" :newLoading="isInster" @add="saveProduct"></queryPart> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </a-card> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <a-card size="small" :bordered="false" class="pages-wrap"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <!-- alert --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <a-alert style="margin-bottom: 15px;" type="info"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <div slot="message"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <span>总款数:{{ countData&&countData.totalCategory }};</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <span>总数量:{{ countData&&countData.totalQty }};</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <span>废品总数量:{{ countData&&countData.totalCelQty }};</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div slot="message" class="total-bar"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <span>总款数:{{ countData&&countData.totalCategory }};</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <span>总数量:{{ countData&&countData.totalQty }};</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <span>废品总数量:{{ countData&&countData.totalCelQty }};</span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              折扣金额: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              折扣:<strong>{{ ordeDetail&&ordeDetail.discountRate || 0 }}%</strong>; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              折后总售价:<strong>¥{{ ordeDetail&&ordeDetail.discountedAmount || 0 }}</strong>; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </a-alert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <!-- 查询条件 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <a-row :gutter="15"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <a-col :span="18"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a-form-model layout="inline" :model="productForm" @submit="handleSearch"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-form-model layout="inline" :model="productForm"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-form-model-item label="产品编码"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              <a-input v-model="productForm.productNo" placeholder="输入产品编码" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-input v-model="productForm.productCode" placeholder="输入产品编码" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </a-form-model-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-form-model-item label="产品名称"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               <a-input v-model="productForm.productName" placeholder="输入产品名称" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </a-form-model-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-form-model-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              <a-button type="primary"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              </a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              <a-button style="margin-left: 10px;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                重置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              </a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-refresh">查询</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesReturn-reset">重置</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </a-form-model-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </a-form-model> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <a-col :span="6"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <div style="float:right;overflow: hidden;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-button id="salesNew-dru">导入明细</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-button type="primary" style="margin-left: 15px" id="salesNew-del-all">整单删除</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-button id="salesReturn-dru">导入明细</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              type="primary" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              @click="salesReturnDelAll" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :loading="delLoading" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              style="margin-left: 10px" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              id="salesReturn-del-all">整单删除</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </a-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </a-row> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -74,39 +91,65 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         :scroll="{ x: 1500, y: 300 }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         bordered> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <!-- 本次退货数量 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <template slot="returnNums" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <editable-cell :text="text" :step="0.1" @change="onCellChange(record.id, 'returnNums', $event)" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <template slot="qty" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <editable-cell 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :text="record.qty" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :max="999999" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :min="0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :precision="0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @change="onCellChange(record.id, 'qty', $event)" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <!-- 废品数量 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <template slot="fpNums" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <editable-cell :text="text" :precision="0" @change="onCellChange(record.id, 'fpNums', $event)" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <template slot="celQty" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <editable-cell 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :text="record.celQty" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :max="999999" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :min="0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :precision="0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @change="onCellChange(record.id, 'celQty', $event)" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <template slot="cangku" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a-select :value="text" style="width: 100%"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-select-option value="jack"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              默认仓库 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            </a-select-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-select-option value="lucy"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              Lucy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            </a-select-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          </a-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <!-- 退货金额小计 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <template slot="returnAmount" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          ¥{{ (record.price * record.qty).toFixed(2) }} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <template slot="cangwei" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a-select :value="text" style="width: 100%"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-select-option value="jack"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              默认仓位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            </a-select-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <a-select-option value="lucy"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              Lucy 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            </a-select-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          </a-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <!-- 仓库仓位 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <template slot="warehouse" slot-scope="text, record, index"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-cascader 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @change="e => changeWarehouseCascade(e, record, index)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            v-model="record.warehouseCascade" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            expand-trigger="hover" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :options="warehouseCascadeData" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :fieldNames="{ label: 'name', value: 'id', children: 'warehouseLocationList' }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            id="bulkWarehousingOrderEdit-warehouseCascade" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            placeholder="请选择仓库仓位" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            style="width: 100%;" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <!-- 操作 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template slot="action" slot-scope="text, record"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a-button type="primary" size="small" @click="handleDel(record)">删除</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            size="small" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type="primary" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :loading="delLoading" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            class="button-error" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @click="handleDel(record)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            id="salesReturn-Del">删除</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </s-table> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </a-card> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <a-affix :offset-bottom="0"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          size="large" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          style="width: 150px;" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          type="primary" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          class="button-primary" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          @click="handleSubmit()" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          id="salesReturn-handleSubmit">提交</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </a-affix> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!-- 选择客户弹框 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </div> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -117,7 +160,8 @@ import { STable, VSelect } from '@/components' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import queryPart from './queryPart.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import EditableCell from '@/views/common/editInput.js' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import chooseCustomModal from './chooseCustomModal.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList } from '@/api/salesReturn' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { warehouseCascadeList } from '@/api/warehouse' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit } from '@/api/salesReturn' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: 'SalesDetail', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   components: { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -134,11 +178,14 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       buyerSn: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       disabled: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       openModal: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      ordeDetai: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      isInster: false, // 是否正在添加产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ordeDetail: { discountAmount: 0 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      delLoading: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      warehouseCascadeData: [], //  仓库仓位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 已选产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       dataSource: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       productForm: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        productNo: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        productCode: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         productName: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       countData: null, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -152,23 +199,28 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '产品编码', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'productNo', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'dealerProductEntity.code', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 160 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '产品名称', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'productName', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'dealerProductEntity.name', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 200 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '原厂编码', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'ycNo', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'dealerProductEntity.origCode', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 160, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          customRender: function (text) { return text || '--' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '销售单号', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'productBrand', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'salesBillNo', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 200 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '售价', 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -179,54 +231,46 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '单位', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'dw', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'dealerProductEntity.unit', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '销售数量', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'salesNums', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'salesQty', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '本次退货数量', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'returnNums', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'qty', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           width: 150, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          scopedSlots: { customRender: 'returnNums' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          scopedSlots: { customRender: 'qty' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '废品数量', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'returnNums', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'celQty', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           width: 150, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          scopedSlots: { customRender: 'fpNums' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          title: '退货存放仓库', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'cangku', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          scopedSlots: { customRender: 'cangku' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          width: 150 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          title: '退货存放仓位', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'cangwei', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          scopedSlots: { customRender: 'cangwei' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          width: 150 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          scopedSlots: { customRender: 'celQty' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '退货金额小计', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'xj', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          scopedSlots: { customRender: 'returnAmount' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title: '折后金额小计', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          dataIndex: 'zhxj', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          align: 'center' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          dataIndex: 'discountedAmount', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align: 'center', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          width: 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      chooseLoadData: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 加载数据方法 必须为 Promise 对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       loadData: parameter => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.disabled = true 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -238,26 +282,27 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           const no = (data.pageNo - 1) * data.pageSize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           for (var i = 0; i < data.list.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             data.list[i].no = no + i + 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const warehouseSn = data.list[i].warehouseSn || undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (warehouseSn || warehouseLocationSn) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              data.list[i].warehouseSnBackups = warehouseSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              data.list[i].warehouseLocationSnBackups = warehouseLocationSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              data.list[i].warehouseCascade = undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.disabled = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.chooseLoadData = data.list 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           return data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    onCellChange (key, dataIndex, value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(key, dataIndex, value) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(this.dataSource) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const dataSource = [...this.dataSource] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      const target = dataSource.find(item => item.id === key) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (target) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        target[dataIndex] = Number(value) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.dataSource = dataSource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    handleSearch () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //  返回 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleBack () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$router.push({ name: 'salesReturnList' }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 选择客户成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     chooseCustomOk (data) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -266,6 +311,62 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handleEditCustom () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.openModal = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    onCellChange (id, key, value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const chooseLoadData = [...this.chooseLoadData] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const row = chooseLoadData.find(item => item.id === id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        row[key] = Number(value) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.log(row.celQty, row.qty) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (row.celQty > row.qty) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.info('废品数量不可大于本次退货数量') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.saveProduct(row, 'edit') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //  仓库仓位  级联  列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    getWarehouseCascade () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      warehouseCascadeList({}).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.warehouseCascadeData = res.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.warehouseCascadeData = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 修改仓库仓位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    changeWarehouseCascade (val, opt, ind) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      console.log(val, opt, ind) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      let loadData = this.chooseLoadData[ind] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (val.length < 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$message.warning('当前仓库无仓位,请选择其他仓库') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const warehouseSnBackups = loadData.warehouseSnBackups || undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const warehouseLocationSnBackups = loadData.warehouseLocationSnBackups || undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData.warehouseSn = warehouseSnBackups 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData.warehouseLocationSn = warehouseLocationSnBackups 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (warehouseSnBackups || warehouseLocationSnBackups) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          loadData.warehouseCascade = [warehouseSnBackups, warehouseLocationSnBackups] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          loadData.warehouseCascade = undefined 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData.warehouseSn = val[0] ? val[0] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData.warehouseLocationSn = val[1] ? val[1] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData.warehouseSnBackups = val[0] ? val[0] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData.warehouseLocationSnBackups = val[1] ? val[1] : '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loadData = this.chooseLoadData[ind] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.log(loadData) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.saveProduct(loadData, 'edit') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 重置列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    resetForm () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.productForm = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        productName: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        productCode: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$refs.table.refresh(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 明细统计 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getQueryCount (params) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       salesReturnQueryCount(params).then(res => { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -275,7 +376,112 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 获取单据详细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getOrderDetail () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       salesReturnDetail({ sn: this.orderSn }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.ordeDetai = res.data || null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.ordeDetail = res.data || null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 打折 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    salesReturnDiscount () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.ordeDetail.discountAmount <= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      salesReturnDiscount({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        discountAmount: this.ordeDetail.discountAmount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        salesReturnSn: this.ordeDetail.salesReturnSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        id: this.ordeDetail.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.resetSearchForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 整单删除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    salesReturnDelAll () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        content: '确认要整单删除吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        closable: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.delLoading = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesReturnDelAll({ sn: _this.ordeDetail.salesReturnSn }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.resetSearchForm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$message.info(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.delLoading = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 删除产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleDel (row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$confirm({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        title: '提示', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        content: '确认要删除吗?', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        centered: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        closable: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        onOk () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          _this.delLoading = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          salesReturnDetailDel({ id: row.id }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              _this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.$message.info(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _this.delLoading = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //  重置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    resetSearchForm (flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$refs.table.refresh(!!flag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.getOrderDetail() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 添加或修改产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    saveProduct (row, type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      console.log(row) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 防止多次添加产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.isInster) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.isInster = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const params = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'salesReturnBillSn': this.orderSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'salesReturnBillNo': this.ordeDetail.salesReturnBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'salesBillSn': row.salesBillSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'salesBillNo': row.salesBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'salesBillDetailSn': row.salesBillDetailSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'price': row.price, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'cost': row.cost, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'productSn': row.productSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'celQty': row.celQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'hasReturnQty': row.hasReturnQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'warehouseLocationSn': row.warehouseLocationSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        'warehouseSn': row.warehouseSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 编辑 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (type == 'edit') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        params.id = row.id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        params.qty = row.qty 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        params.salesQty = row.qty 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      salesReturnSaveProduct(params).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.resetSearchForm(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.isInster = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 提交销售单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleSubmit () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      salesReturnSubmit({ sn: this.orderSn }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (res.status == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.handleBack() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message.success(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -284,6 +490,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.orderSn = this.$route.params.sn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.buyerSn = this.$route.params.buyerSn 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this.getOrderDetail() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.getWarehouseCascade() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   beforeRouteEnter (to, from, next) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     next(vm => { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -299,5 +506,20 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .sTable{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       margin-top: 15px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    .total-bar{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      display: flex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      align-items: center; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      justify-content: space-between; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      > div{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        &:last-child{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          display: flex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          align-items: center; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          justify-content: space-between; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          > div{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            padding: 0 10px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </style> 
			 |