lilei 2 anni fa
parent
commit
f801c5ec73

+ 8 - 1
src/api/salesReturn.js

@@ -49,7 +49,14 @@ export const salesReturnInsert = (params) => {
     method: 'post'
   })
 }
-
+// 修改销售退货单基本信息
+export const salesReturnModify = (params) => {
+  return axios({
+    url: '/salesReturn/modify',
+    data: params,
+    method: 'post'
+  })
+}
 // 销售退货单付款
 export const salesReturnPay = (params) => {
   return axios({

+ 5 - 1
src/views/common/chooseWarehouse.js

@@ -4,7 +4,7 @@ const warehouse = {
       <a-select
         :placeholder="placeholder"
         :id="id"
-        allowClear
+        :allowClear="allowClear"
         :value="defaultVal"
         :showSearch="true"
         :disabled="disabled"
@@ -23,6 +23,10 @@ const warehouse = {
       type: Boolean,
       default: false
     },
+    allowClear:{
+      type: Boolean,
+      default: true
+    },
     id: {
       type: String,
       default: ''

+ 3 - 3
src/views/productManagement/shelfNoManage/list.vue

@@ -31,7 +31,7 @@
                   <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="shelfNoMan-productType"></productTypeAll>
                 </a-form-item>
               </a-col>
-              <a-col :md="4" :sm="24" v-show="isShowWarehouse">
+              <!-- <a-col :md="4" :sm="24" v-show="isShowWarehouse">
                 <a-form-item label="仓库">
                   <warehouse
                     v-model="queryParam.product.warehouseSn"
@@ -40,7 +40,7 @@
                     placeholder="请选择仓库"
                   />
                 </a-form-item>
-              </a-col>
+              </a-col> -->
               <a-col :md="4" :sm="24">
                 <a-form-item label="产品状态">
                   <v-select code="PRODUCT_STATUS" id="shelfNoMan-state" v-model="queryParam.product.state" allowClear placeholder="请选择产品状态"></v-select>
@@ -220,7 +220,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ]
       if (this.isShowWarehouse) {
-        arr.splice(6, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
+        // arr.splice(6, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
       }
 	    return arr
 	  }

+ 1 - 10
src/views/salesReturnManagement/salesReturn/list.vue

@@ -31,15 +31,6 @@
                   <a-input id="salesReturn-purchaseReturnApplyNo" v-model.trim="queryParam.purchaseReturnApplyNo" allowClear placeholder="请输入客户采退申请单号"/>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="退货仓库">
-                  <warehouse
-                    v-model="queryParam.warehouseSn"
-                    id="salesReturn-warehouseSn"
-                    placeholder="请选择退货仓库"
-                  />
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="单据来源">
                   <v-select
@@ -85,7 +76,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="退货仓库">
-                  <chooseWarehouse ref="warehouse" @change="handleWarehouse"></chooseWarehouse>
+                  <warehouse ref="warehouse" v-model="queryParam.warehouseSn"></warehouse>
                 </a-form-model-item>
               </a-col>
             </template>

+ 2 - 1
src/views/salesReturnManagement/salesReturn/queryPart.vue

@@ -165,8 +165,9 @@ export default {
       this.queryParam.productCode = ''
       this.$refs.table.refresh(true)
     },
-    pageInit (buyerSn) {
+    pageInit (buyerSn, warehouseSn) {
       this.buyerSn = buyerSn
+      this.queryParam.warehouseSn = warehouseSn
       const arr = [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },

+ 25 - 7
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -9,7 +9,9 @@
           <span style="margin: 0 15px;color: #666;" v-if="ordeDetail">
             退货仓库:<warehouse
                style="width:200px;"
+               :allowClear="false"
                 v-model="ordeDetail.warehouseSn"
+                @change="updateWarehouse"
                 id="basicInfo-warehouseSn"
                 placeholder="请选择退货仓库"
               />
@@ -73,7 +75,7 @@
                 </a-col>
                 <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                   <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled">查询</a-button>
-                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled">重置</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm(true)" :disabled="disabled">重置</a-button>
                 </a-col>
               </a-row>
             </a-form>
@@ -170,7 +172,8 @@ import {
   salesReturnSubmit,
   salesReturnBatchInsert,
   salesReturnPrint,
-  salesReturnExport
+  salesReturnExport,
+  salesReturnModify
 } from '@/api/salesReturn'
 import {
   salesReturnDetailList,
@@ -304,6 +307,19 @@ export default {
         record.initialQty = valBackups
       }
     },
+    // 修改仓库
+    updateWarehouse(warehouseSn){
+      const _this = this
+      _this.spinning = true
+      const params = {id:this.ordeDetail.id,warehouseSn: warehouseSn}
+      salesReturnModify(params).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.getOrderDetail()
+        }
+        _this.spinning = false
+      })
+    },
     // 修改退货原因
     updateReason (row) {
       console.log(row.returnReason)
@@ -359,9 +375,12 @@ export default {
       }
     },
     // 获取单据详细
-    getOrderDetail () {
+    getOrderDetail (flag) {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if(!flag){
+          this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn)
+        }
       })
     },
     // 删除产品
@@ -388,14 +407,14 @@ export default {
     },
     resetTable (flag) {
       this.$refs.table.refresh(flag)
-      this.getOrderDetail()
+      this.getOrderDetail(true)
     },
     //  重置
     resetSearchForm (flag) {
       this.productForm.productName = ''
       this.productForm.productCode = ''
       this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
+      this.getOrderDetail(flag)
     },
     // 添加或修改产品
     saveProduct (row) {
@@ -484,8 +503,7 @@ export default {
     pageInit () {
       this.orderSn = this.$route.params.sn
       this.buyerSn = this.$route.params.buyerSn
-      this.resetSearchForm(true)
-      this.$refs.partQuery.pageInit(this.buyerSn, 0)
+      this.resetSearchForm()
     }
   },
   mounted () {