Ver código fonte

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

chenrui 11 meses atrás
pai
commit
c119ba9e7a

+ 9 - 0
src/api/salesNew.js

@@ -22,6 +22,15 @@ export const salesList = (params) => {
         }
     })
 }
+// 第三方库存
+export const getThirdStockQty = (params) => {
+    return axios({
+        url: `/sunFulcess/getStockQty`,
+        data: params,
+        method: 'post'
+    })
+}
+
 // 是否已转采购单
 export const getCreatePurchaseFlag = (params) => {
     return axios({

+ 5 - 1
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -241,7 +241,7 @@ export default {
         arr.push({ title: '库存', field: 'stockQty', width: 80, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         if (this.showStockCol) {
           this.colspanNums = this.colspanNums + 1
-          arr.push({ title: '第三方库存', field: 'stockQty', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+          arr.push({ title: '第三方库存', field: 'thirdStockQty', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         }
       }
       this.colspanNums = this.colspanNums + 3
@@ -314,6 +314,10 @@ export default {
         })
       })
     },
+    // 显示第三方库存
+    showThreeStock () {
+      this.showStockCol = true
+    },
     // 查询表格数据
     async searchTable () {
       this.dataSource = []

+ 3 - 2
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -431,7 +431,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
       if (this.showStockCol) {
-        arr.splice(6, 0, { title: '第三方库存', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+        arr.splice(6, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '6%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
       }
       // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) {
@@ -469,8 +469,9 @@ export default {
       this.showSearchBox = !this.showSearchBox
     },
     // 查询第三方库存
-    searchThreeStock () {
+    searchThreeStockOk () {
       this.showStockCol = true
+      this.resetSearchForm()
     },
     // 显示规则详细
     showDesc (descDetail) {

+ 15 - 3
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -32,7 +32,13 @@
           <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-button style="margin-left: 15px" type="primary" class="button-info" @click="searchThreeStock" id="salesEdit-updateStock">第三方库存</a-button>
+            <a-button
+              :loading="loading"
+              style="margin-left: 15px"
+              type="primary"
+              class="button-info"
+              @click="searchThreeStock"
+              id="salesEdit-updateStock">第三方库存</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -238,6 +244,7 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -257,6 +264,7 @@ export default {
             this.dataSource = data.list
           }
           this.disabled = false
+          this.loading = false
           return data
         })
       },
@@ -305,7 +313,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.showStockCol) {
-        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'stockQty', width: '8%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '8%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
       }
       // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) {
@@ -337,9 +345,13 @@ export default {
     },
     // 查询第三方库存
     searchThreeStock () {
-      this.showStockCol = true
+      this.loading = true
       this.$emit('allThreeStock')
     },
+    searchThreeStockOk () {
+      this.showStockCol = true
+      this.resetSearchForm()
+    },
     // 获取统计
     getCount () {
       salesDetaiCount(Object.assign(this.queryParam, { showStock: true })).then(res => {

+ 11 - 3
src/views/salesManagement/salesQueryNew/detail.vue

@@ -133,7 +133,7 @@
               </a-form>
             </div>
             <div>
-              <a-button id="salesDetail-updateStock" v-if="showStock" @click="getThreeStock" type="link" class="button-info">第三方库存</a-button>
+              <a-button id="salesDetail-updateStock" type="primary" v-if="showStock" @click="getThreeStock" class="button-info">第三方库存</a-button>
               <a-button id="salesDetail-stockOut" v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
               <a-checkbox id="salesDetail-cityPrice" v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
             </div>
@@ -242,7 +242,8 @@ import {
   salesDetailTypeExcel,
   salesWriteAuditPass,
   salesWriteAuditReject,
-  salesWriteAuditPush
+  salesWriteAuditPush,
+  getThirdStockQty
 } from '@/api/salesNew'
 
 export default {
@@ -335,7 +336,14 @@ export default {
     },
     // 查询第三方库存
     getThreeStock () {
-      this.$refs.productList.showStockCol = true
+      this.spinning = true
+      getThirdStockQty({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.$refs.productList.showThreeStock()
+          this.resetSearchForm()
+        }
+        this.spinning = false
+      })
     },
     // 详情
     getDetail () {

+ 16 - 8
src/views/salesManagement/salesQueryNew/edit.vue

@@ -167,7 +167,7 @@ import chooseProduct from './comps/chooseProduct.vue'
 import setPriceModal from './setPriceModal.vue'
 import newPromoModal from './newPromoModal.vue'
 import { salesDisablePromo, salesEnablePromoPromo, salesChangePromo } from '@/api/salesDetailNew'
-import { salesDetailBySn, salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo, salesPromoValidaSubmit } from '@/api/salesNew'
+import { salesDetailBySn, salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo, salesPromoValidaSubmit, getThirdStockQty } from '@/api/salesNew'
 export default {
   name: 'SalesNewEdit',
   mixins: [commonMixin],
@@ -274,14 +274,22 @@ export default {
     },
     // 刷新所有第三方库存
     searchAllThreeStock () {
-      const activeList = this.activeList
-      // 刷新所有活动产品列表
-      activeList.map(item => {
-        item.isActive = true
-        const row = this.$refs['productList-' + item.promoRuleSn][0]
-        row && row.searchThreeStock()
+      this.spinning = true
+      getThirdStockQty({ salesBillSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          // 刷新正常活动产品列表
+          this.$refs.productNormalList.searchThreeStockOk()
+          // 刷新所有活动产品列表
+          const activeList = this.activeList
+          activeList.map(item => {
+            item.isActive = true
+            const row = this.$refs['productList-' + item.promoRuleSn][0]
+            row && row.searchThreeStockOk()
+          })
+          activeList.splice()
+        }
+        this.spinning = false
       })
-      activeList.splice()
     },
     // 刷新所有表格数据
     updateAllTable (flag) {

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.117/ocs-admin',
+        target: 'http://192.168.2.113:8660/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {