Bladeren bron

退货单编辑

lilei 4 jaren geleden
bovenliggende
commit
636d450bf4

+ 1 - 1
src/api/salesReturn.js

@@ -27,7 +27,7 @@ export const salesReturnDel = (params) => {
 // 根据SN查询销售退货单
 export const salesReturnDetail = (params) => {
   return axios({
-    url: `/salesReturn/findBySn/${params.salesReturnBillSn}`,
+    url: `/salesReturn/findBySn/${params.sn}`,
     method: 'get'
   })
 }

+ 34 - 10
src/views/salesManagement/salesReturn/list.vue

@@ -81,8 +81,7 @@
     <a-alert type="info" style="margin-bottom: 10px;">
       <div slot="message">
         退货总金额:<strong>{{ countData&&countData.totalAmount }}</strong>元;
-        总单数:<strong>{{ countData&&countData.totalBillNumber }}</strong>;
-        总款数:<strong>{{ countData&&countData.totalCategory }}</strong>;
+        总单数:<strong>{{ countData&&countData.totalRecord }}</strong>;
         总数量:<strong>{{ countData&&countData.totalQty }}</strong>;
       </div>
     </a-alert>
@@ -110,24 +109,45 @@
           size="small"
           type="link"
           class="button-warning"
-          v-if="record.state == 'WAIT_AUDIT'"
+          v-if="record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE'"
           @click="handleEexamine(record)"
           id="salesReturn-eexamine-btn">审核</a-button>
         <a-button
           size="small"
-          v-if="record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT'"
+          type="link"
+          class="button-warning"
+          v-if="record.billStatus == 'AUDIT_CHECK'"
+          @click="handleCheck(record)"
+          id="salesReturn-eexamine-btn">品检</a-button>
+        <a-button
+          size="small"
+          v-if="record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT')"
           type="link"
           class="button-info"
           @click="handleEdit(record)"
           id="salesReturn-edit-btn">编辑</a-button>
         <a-button
           size="small"
-          v-if="record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT'"
+          v-if="record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')"
+          type="link"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="salesReturn-edit-btn">改单</a-button>
+        <a-button
+          size="small"
+          v-if="record.salesReturnBillSource == 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'WAIT_SUBMIT')"
           type="link"
           class="button-error"
           @click="handleDel(record)"
           id="salesReturn-del-btn">删除</a-button>
-        <span v-if="record.state == 'FINISH'">--</span>
+        <a-button
+          size="small"
+          v-if="record.salesReturnBillSource != 'SALES' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+          id="salesReturn-del-btn">取消</a-button>
+        <span v-if="record.billStatus == 'FINISH'||record.billStatus == 'CANCEL'||record.billStatus == 'AUDIT_REJECT'||record.billStatus == 'FINANCIAL_REJECT'||record.billStatus == 'WAIT_FINANCIAL_AUDIT'">--</span>
       </template>
     </s-table>
     <!-- 选择客户弹框 -->
@@ -175,14 +195,14 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 120, align: 'center' },
+        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: 120, align: 'center' },
         { title: '客户采退单号', dataIndex: 'purchaseReturnBillNo', width: 260, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: 260, align: 'center' },
         { title: '退货客户', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '退货数量', dataIndex: 'totalQty', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '返库数量', dataIndex: 'totalBackStockQty', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退款金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退款金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '是否抓单', dataIndex: 'grabFlag', width: 100, align: 'center', customRender: function (text) { return ['否', '是'][text] } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
@@ -242,11 +262,11 @@ export default {
     // 编辑
     handleEdit (row) {
       console.log(row)
-      this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { sn: row.salesReturnBillNo, buyerSn: row.buyerSn } })
+      this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
     },
     // 详情
     handleDetail (row) {
-      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillNo } })
+      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn } })
     },
     // 删除
     handleDel (row) {
@@ -283,6 +303,10 @@ export default {
           })
         }
       })
+    },
+    // 品检
+    handleCheck () {
+
     },
     resetSearchForm () {
       this.queryParam.buyerSn = undefined

+ 40 - 57
src/views/salesManagement/salesReturn/queryPart.vue

@@ -5,8 +5,8 @@
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="审核时间">
-              <a-range-picker v-model="shDate" id="salesReturn-shDate"/>
+            <a-form-item label="销售单号">
+              <a-input id="productInfoList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -19,20 +19,9 @@
               <a-input id="productInfoList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="销售单号">
-                <a-input id="productInfoList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-              </a-form-item>
-            </a-col>
-          </template>
           <a-col :md="6" :sm="24">
             <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
             <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin:0 15px 0 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
           </a-col>
         </a-row>
       </a-form>
@@ -49,9 +38,17 @@
       :defaultLoadData="false"
       :scroll="{ x: grabFlag == '1' ? 1700 : 860, y: 300 }"
       bordered>
-      <!-- 价格 -->
-      <template slot="price" slot-scope="text, record">
-        ¥ {{ text }}
+      <!-- 本次退货数量 -->
+      <template slot="qty" slot-scope="text, record">
+        <div @dblclick.stop>
+          <a-input-number
+            size="small"
+            v-model="record.qty"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            placeholder="请输入" />
+        </div>
       </template>
       <span slot="customTitle">
         操作
@@ -77,8 +74,8 @@
 </template>
 
 <script>
-import { salesReturnProductList, salesQueryByReturn } from '@/api/salesReturn'
-import { querySumByProductLocation } from '@/api/stock'
+import { salesQueryByReturn } from '@/api/salesReturn'
+import { queryStockProductPage } from '@/api/stock'
 import { STable, VSelect } from '@/components'
 import moment from 'moment'
 export default {
@@ -96,7 +93,6 @@ export default {
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
-      shDate: [],
       dateFormat: 'YYYY-MM-DD',
       queryParam: { //  查询条件
         salesBillNo: '', //  销售单号
@@ -115,23 +111,17 @@ export default {
         if (this.grabFlag == 1) {
           this.queryParam.buyerSn = this.buyerSn
         }
-        // 创建时间
-        if (this.shDate && this.shDate.length > 0) {
-          this.queryParam.beginDate = moment(this.shDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.shDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
-        const fun = [salesQueryByReturn, salesReturnProductList]
+        // 不抓单
         if (this.grabFlag == 0) {
           this.queryParam.salePriceType = this.priceType
         }
+        const fun = [queryStockProductPage, salesQueryByReturn]
         return fun[this.grabFlag](Object.assign(parameter, this.queryParam)).then(res => {
           const 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].qty = 1
           }
           this.disabled = false
           return data
@@ -148,63 +138,56 @@ export default {
         align: 'center',
         width: 100
       },
+      {
+        title: '销售单号',
+        dataIndex: 'salesBillNo',
+        align: 'center',
+        width: 160
+      },
       {
         title: '产品编码',
-        dataIndex: 'dealerProductEntity.code',
+        dataIndex: 'productEntity.code',
         align: 'center',
-        sorter: true,
         width: 160
       },
       {
         title: '产品名称',
-        dataIndex: 'dealerProductEntity.name',
+        dataIndex: 'productEntity.name',
         align: 'center'
       },
       {
-        title: '原厂编码',
-        dataIndex: 'dealerProductEntity.origCode',
+        title: '售价',
+        dataIndex: 'price',
         align: 'center',
-        customRender: function (text) { return text || '--' },
+        customRender: function (text) { return '¥' + (text || 0) },
         width: 120
       },
       {
-        title: '销售单号',
-        dataIndex: 'salesBillNo',
+        title: '剩余可退数量',
+        dataIndex: 'refundableQty',
         align: 'center',
-        width: 160
+        width: 100
       },
       {
-        title: '销售审核时间',
-        dataIndex: 'auditTime',
+        title: '本次退货数量',
+        dataIndex: 'qty',
         align: 'center',
-        customRender: function (text) { return text || '--' },
+        scopedSlots: { customRender: 'qty' },
         width: 120
       },
       {
-        title: '价',
-        dataIndex: 'price',
+        title: '采购价',
+        dataIndex: 'showCost',
         align: 'center',
-        width: 120,
-        scopedSlots: { customRender: 'price' }
+        customRender: function (text) { return '¥' + (text || 0) },
+        width: 120
       },
       {
         title: '单位',
-        dataIndex: 'dealerProductEntity.unit',
-        align: 'center',
-        width: 100
-      },
-      {
-        title: '销售数量',
-        dataIndex: 'qty',
+        dataIndex: 'productEntity.unit',
         align: 'center',
         width: 100
       },
-      {
-        title: '已退数量',
-        dataIndex: 'hasReturnQty',
-        align: 'center',
-        width: 120
-      },
       { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }]
     } else {
       this.columns = [{

+ 56 - 203
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -33,53 +33,13 @@
       <a-alert style="margin-bottom: 10px;" type="info">
         <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>
+            <span>退货总金额:{{ ordeDetail&&ordeDetail.totalAmount }}元;</span>
+            <span>退货总数量:{{ ordeDetail&&ordeDetail.totalQty }};</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">
-            <a-form-model-item label="产品编码">
-              <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 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="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>
       <!-- 已选配件列表 -->
       <s-table
         class="sTable"
@@ -101,32 +61,13 @@
             @change="onCellChange(record.id, 'qty', $event)" />
         </template>
         <!-- 废品数量 -->
-        <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 slot="remarks" slot-scope="text, record">
+          <a-input placeholder="30个字符内" maxlength="30" v-model="record.remarks" @change="updateRemark(record)"></a-input>
         </template>
         <!-- 退货金额小计 -->
         <template slot="returnAmount" slot-scope="text, record">
           ¥{{ (record.price * record.qty).toFixed(2) }}
         </template>
-        <!-- 仓库仓位 -->
-        <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"
-            :allowClear="false"
-            :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-            id="bulkWarehousingOrderEdit-warehouseCascade"
-            placeholder="请选择仓库仓位"
-            style="width: 100%;" />
-        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -158,8 +99,14 @@
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import EditableCell from '@/views/common/editInput.js'
-import { warehouseCascadeList } from '@/api/warehouse'
-import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit } from '@/api/salesReturn'
+import { salesReturnDetail, salesReturnSubmit } from '@/api/salesReturn'
+import {
+  salesReturnDetailList,
+  salesReturnDetailDel,
+  salesReturnDetailInsert,
+  salesReturnDetailUpdateQty,
+  salesReturnDetailUpdateReason
+} from '@/api/salesReturnDetail'
 export default {
   name: 'SalesDetail',
   components: {
@@ -181,10 +128,8 @@ export default {
       // 已选产品
       dataSource: [],
       productForm: {
-        productCode: '',
-        productName: ''
+        salesReturnBillSn: ''
       },
-      countData: null,
       // 表头
       columns: [
         {
@@ -193,6 +138,12 @@ export default {
           align: 'center',
           width: 100
         },
+        {
+          title: '采购单号',
+          dataIndex: 'purchaseBillNo',
+          align: 'center',
+          width: 200
+        },
         {
           title: '产品编码',
           dataIndex: 'dealerProductEntity.code',
@@ -206,24 +157,24 @@ export default {
           width: 200
         },
         {
-          title: '原厂编码',
-          dataIndex: 'dealerProductEntity.origCode',
+          title: '剩余可退数量',
+          dataIndex: 'refundableQty',
           align: 'center',
-          width: 160,
-          customRender: function (text) { return text || '--' }
+          width: 100
         },
         {
-          title: '销售单号',
-          dataIndex: 'salesBillNo',
+          title: '本次退货数量',
+          dataIndex: 'qty',
           align: 'center',
-          width: 200
+          width: 150,
+          scopedSlots: { customRender: 'qty' }
         },
         {
-          title: '价',
+          title: '退货单价',
           dataIndex: 'price',
+          customRender: function (text) { return '¥' + (text || 0) },
           align: 'center',
-          width: 150,
-          scopedSlots: { customRender: 'price' }
+          width: 150
         },
         {
           title: '单位',
@@ -232,37 +183,18 @@ export default {
           width: 100
         },
         {
-          title: '销售数量',
-          dataIndex: 'salesQty',
+          title: '退货小计',
           align: 'center',
+          dataIndex: 'totalAmount',
+          customRender: function (text) { return '¥' + (text || 0) },
           width: 100
         },
         {
-          title: '本次退货数量',
-          dataIndex: 'qty',
+          title: '退货原因',
+          dataIndex: 'remarks',
           align: 'center',
           width: 150,
-          scopedSlots: { customRender: 'qty' }
-        },
-        {
-          title: '废品数量',
-          dataIndex: 'celQty',
-          align: 'center',
-          width: 150,
-          scopedSlots: { customRender: 'celQty' }
-        },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
-        {
-          title: '退货金额小计',
-          align: 'center',
-          scopedSlots: { customRender: 'returnAmount' },
-          width: 100
-        },
-        {
-          title: '折后金额小计',
-          dataIndex: 'discountedAmount',
-          align: 'center',
-          width: 100
+          scopedSlots: { customRender: 'remarks' }
         },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
@@ -272,21 +204,11 @@ export default {
         this.disabled = true
         // 查询总计
         this.productForm.salesReturnBillSn = this.$route.params.sn
-        this.getQueryCount(Object.assign(parameter, this.productForm))
         return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
           const 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
-            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
@@ -300,118 +222,50 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesReturnList' })
     },
+    // 修改退货数量
     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('废品数量不可大于本次退货数量')
+        if (row.qty > row.refundableQty) {
+          this.$message.info('本次退货数量不可大于剩余可退数量')
           this.$refs.table.refresh(true)
         } else {
-          this.saveProduct(row, 'edit')
+          salesReturnDetailUpdateQty({
+            salesReturnDetailSn: row.salesReturnDetailSn,
+            qty: row.qty
+          }).then(res => {
+            if (res.status == 200) {
+              this.resetSearchForm(true)
+              this.$message.success(res.message)
+            }
+          })
         }
       }
     },
-    //  仓库仓位  级联  列表
-    getWarehouseCascade () {
-      warehouseCascadeList({}).then(res => {
+    // 修改退货原因
+    updateRemark (row) {
+      salesReturnDetailUpdateReason({
+        salesReturnDetailSn: row.salesReturnDetailSn,
+        remarks: row.remarks
+      }).then(res => {
         if (res.status == 200) {
-		  res.data.map(item => {
-		    item.sn = item.warehouseSn
-		    if (item.warehouseLocationList) {
-		  	item.warehouseLocationList.map(subItem => {
-		  	  subItem.sn = subItem.warehouseLocationSn
-		  	})
-		    }
-		  })
-          this.warehouseCascadeData = res.data
-        } else {
-          this.warehouseCascadeData = []
+          this.resetSearchForm(true)
+          this.$message.success(res.message)
         }
       })
     },
-    // 修改仓库仓位
-    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 => {
-        this.countData = res.data || null
-      })
-    },
     // 获取单据详细
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         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
@@ -466,7 +320,7 @@ export default {
       } else {
         params.salesQty = row.qty
       }
-      salesReturnSaveProduct(params).then(res => {
+      salesReturnDetailInsert(params).then(res => {
         this.resetSearchForm(true)
         this.isInster = false
       })
@@ -485,7 +339,6 @@ export default {
     this.orderSn = this.$route.params.sn
     this.buyerSn = this.$route.params.buyerSn
     this.getOrderDetail()
-    this.getWarehouseCascade()
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {