Explorar o código

Merge branch 'develop_fencang' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_fencang

lilei %!s(int64=2) %!d(string=hai) anos
pai
achega
cc92d93b6d

+ 9 - 1
src/api/sales.js

@@ -40,7 +40,7 @@ export const salesDetailByNo = (params) => {
     method: 'get'
   })
 }
-//  销售 新增或编辑
+//  销售 新增
 export const salesSave = (params) => {
   return axios({
     url: '/sales/insert',
@@ -48,6 +48,14 @@ export const salesSave = (params) => {
     method: 'post'
   })
 }
+// 销售 编辑
+export const salesModify = (params) => {
+  return axios({
+    url: '/sales/modify',
+    data: params,
+    method: 'post'
+  })
+}
 
 //  销售 打印
 export const salesPrint = (params) => {

+ 1 - 1
src/config/router.config.js

@@ -176,7 +176,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'edit/:sn',
+                path: 'edit/:sn/:wSn',
                 name: 'salesEdit',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/edit.vue'),
                 meta: {

+ 1 - 0
src/views/basicData/warehouse/editModal.vue

@@ -170,6 +170,7 @@ export default {
           districtSn: this.nowData.districtSn ? this.nowData.districtSn : '',
           districtName: this.nowData.districtName ? this.nowData.districtName : '',
           erpWarehouseCode: this.nowData.erpWarehouseCode ? this.nowData.erpWarehouseCode : '', // ERP仓库编码
+          warehouseType:this.nowData.warehouseType ? this.nowData.warehouseType : '',
           addressInfo: addressVal
         }
       }

+ 20 - 7
src/views/salesManagement/salesQuery/edit.vue

@@ -8,7 +8,7 @@
           <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
           <div style="width:420px;display:inline-block;color: #666;">
             <span>出库仓库:</span>
-            <chooseWarehouse style="width:80%" ref="warehouse" v-model="productForm.warehouseSn" @change="handleWarehouse"></chooseWarehouse>
+            <chooseWarehouse style="width:80%" ref="warehouse" v-model="warehouseSn" @change="handleWarehouse"></chooseWarehouse>
           </div>
         </template>
       </a-page-header>
@@ -228,7 +228,7 @@ import queryPromotable from './queryPromotable.vue'
 import ChooseActive from './chooseActive.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
-import { salesDetailBySn, salesWriteSubmit, getPromoacActiveList, deleteAll } from '@/api/sales'
+import { salesModify, salesDetailBySn, salesWriteSubmit, getPromoacActiveList, deleteAll } from '@/api/sales'
 import { salesDetailStockList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, salesDetailDelAll, addPromoGoods, salesBatchInsert } from '@/api/salesDetail'
 export default {
   name: 'SalesEdit',
@@ -247,9 +247,9 @@ export default {
       dataSource: [],
       productForm: {
         salesBillSn: '',
-        promotionFlag: 0,
-        warehouseSn: undefined
+        promotionFlag: 0
       },
+      warehouseSn: undefined,
       activeName: '', // 促销活动
       nowData: null,
       // 加载数据方法 必须为 Promise 对象
@@ -306,7 +306,20 @@ export default {
   methods: {
     // 选择仓库
     handleWarehouse (val) {
-      this.productForm.warehouseSn = val
+      this.warehouseSn = val
+      const _this = this
+      _this.spinning = true
+      salesModify({
+        id: _this.detailData.id,
+        warehouseSn: val
+      }).then(res => {
+        if (res.status == 200) {
+          _this.$refs.partQuery.resetCurForm(val)
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
     },
     handleMenuClick (e) {
       if (e.key == 1) { // 删除已选项
@@ -507,7 +520,7 @@ export default {
         if (res.status == 200) {
           this.detailData = res.data
           if (flag) {
-            this.$refs.partQuery.pageInit(this.detailData && this.detailData.buyerSn || '')
+            this.$refs.partQuery.pageInit(this.detailData && this.detailData.buyerSn || '', this.warehouseSn)
           }
         }
       })
@@ -589,7 +602,7 @@ export default {
       this.getOrderDetail(true)
       this.$refs.table.refresh(true)
       this.salesBillSn = this.$route.params.sn
-      this.productForm.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
+      this.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
       // 获取促销活动
       this.getPromoacActiveList()
     }

+ 10 - 4
src/views/salesManagement/salesQuery/queryPart.vue

@@ -124,7 +124,8 @@ export default {
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        warehouseSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -202,13 +203,18 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
-    pageInit (buyerSn) {
+    pageInit (buyerSn, warehouseSn) {
       this.buyerSn = buyerSn
+      this.queryParam.warehouseSn = warehouseSn
       this.resetSearchForm()
     },
     // 刷新当前页面
-    resetCurForm () {
-      this.$refs.table.refresh()
+    resetCurForm (warehouseSn) {
+      this.queryParam.warehouseSn = warehouseSn
+      const _this = this
+      _this.$nextTick(() => {
+        _this.$refs.table.refresh()
+      })
     },
     // 选择配件
     handleAdd (row) {