Bladeren bron

选择货架产品

lilei 2 jaren geleden
bovenliggende
commit
3f93c2ff2c

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
 {
   "message": "发现有新版本发布,确定更新系统?",
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
   "vendorJsVersion": "",
-  "version": 1667982251869
+  "version": 1668071782576
 }
 }

+ 8 - 0
src/api/shelf.js

@@ -19,6 +19,14 @@ export const shelfDetail = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 查询客户关联的货架
+export const queryByCustomerSn = (params) => {
+  return axios({
+    url: `/shelf/queryByCustomerSn/${params.sn}`,
+    data: params,
+    method: 'post'
+  })
+}
 //待补货产品列表
 //待补货产品列表
 export const queryListForReplenish = (params) => {
 export const queryListForReplenish = (params) => {
   return axios({
   return axios({

+ 17 - 0
src/api/shelfReplenish.js

@@ -147,3 +147,20 @@ export const shelfReplenishTaskInsertBill = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+
+// 待补货产品 
+export const queryWaitReplenish = (params) => {
+  return axios({
+    url: '/shelfProduct/queryWaitReplenish',
+    data: params,
+    method: 'post'
+  })
+}
+// 货架产品
+export const queryShelfProduct = (params) => {
+  return axios({
+    url: '/shelfProduct/queryShelfProduct',
+    data: params,
+    method: 'post'
+  })
+}

+ 7 - 2
src/views/numsGoodsShelves/replenishmentManagement/detailModal.vue

@@ -155,8 +155,13 @@ export default {
     },
     },
     // 生成销售单
     // 生成销售单
     createSales () {
     createSales () {
-      createSalesBill().then(res => {
-
+      this.spinning = true
+      createSalesBill({ replenishBillSn: this.nowData.replenishBillSn }).then(res => {
+        if (res.status == 200) {
+          this.$message.info(res.message)
+          this.getSalesOrder()
+        }
+        this.spinning = false
       })
       })
     },
     },
     pageInit () {
     pageInit () {

+ 108 - 43
src/views/salesManagement/salesQuery/chooseShelfProduct.vue

@@ -10,7 +10,7 @@
     width="80%">
     width="80%">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-tabs>
       <a-tabs>
-        <a-tab-pane key="1" tab="待补货产品" force-render>
+        <a-tab-pane :defaultActiveKey="curTab" v-model="curTab" :key="1" tab="待补货产品">
           <!-- 搜索条件 -->
           <!-- 搜索条件 -->
           <div class="table-page-search-wrapper">
           <div class="table-page-search-wrapper">
             <a-form-model
             <a-form-model
@@ -37,7 +37,7 @@
                 </a-col>
                 </a-col>
                 <a-col :md="6" :sm="24">
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="库存情况">
                   <a-form-model-item label="库存情况">
-                    <a-checkbox-group :options="options" @change="onStockChange" />
+                    <a-checkbox-group v-model.trim="queryParam.stockStateList" :options="options" />
                   </a-form-model-item>
                   </a-form-model-item>
                 </a-col>
                 </a-col>
                 <a-col :md="6" :sm="12" style="margin-bottom: 10px;">
                 <a-col :md="6" :sm="12" style="margin-bottom: 10px;">
@@ -50,8 +50,8 @@
           <div class="chooseShelf-modal-table">
           <div class="chooseShelf-modal-table">
             <div class="table-operator">
             <div class="table-operator">
               <div>
               <div>
-                <a-button type="primary" class="button-error">批量添加</a-button>
-                <span v-if="selectTotal">已选{{ selectTotal }}项</span>
+                <a-button type="primary">批量添加</a-button>
+                <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
               </div>
               </div>
               <div>
               <div>
                 <a-icon type="info-circle" />
                 <a-icon type="info-circle" />
@@ -64,18 +64,63 @@
               ref="table"
               ref="table"
               size="small"
               size="small"
               :rowKey="(record) => record.id"
               :rowKey="(record) => record.id"
-              :row-selection="{columnWidth: 40}"
+              :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.includeFlag == 1 } })}"
               @rowSelection="rowSelectionFun"
               @rowSelection="rowSelectionFun"
               :columns="columns"
               :columns="columns"
               :data="loadData"
               :data="loadData"
               :scroll="{ y: 450 }"
               :scroll="{ y: 450 }"
-              :defaultLoadData="false"
               :showPagination="false"
               :showPagination="false"
               bordered>
               bordered>
+              <!-- 售价 -->
+              <template slot="salePrice" slot-scope="text, record">
+                <div style="display: flex;align-items: center;" @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-model="record.price"
+                    :precision="2"
+                    :min="0"
+                    :max="999999"
+                    style="width: 100%;"
+                    placeholder="请输入" />
+                  <span style="color: red;margin: 0 2px;font-size: 14px;" v-if="record.origSalePriceFlag == 1">原</span>
+                  <span v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+                </div>
+              </template>
+              <!-- 销售数量 -->
+              <template slot="nums" slot-scope="text, record">
+                <div @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-model="record.salesNums"
+                    :precision="0"
+                    :min="0"
+                    :max="999999"
+                    style="width: 100%;"
+                    placeholder="请输入" />
+                </div>
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  @click.stop="handleAdd(record)"
+                  v-if="record.includeFlag != 1"
+                  id="productInfoList-edit-btn">添加</a-button>
+                <span style="color:#999;" v-else>已添加</span>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  @click.stop="handleDetail(record)"
+                  id="productInfoList-detail-btn"
+                  style="margin-left: 5px;">销售记录</a-button>
+              </template>
             </s-table>
             </s-table>
           </div>
           </div>
         </a-tab-pane>
         </a-tab-pane>
-        <a-tab-pane key="2" tab="全部货架产品" force-render>
+        <a-tab-pane :key="2" tab="全部货架产品">
           <!-- 搜索条件 -->
           <!-- 搜索条件 -->
           <div class="table-page-search-wrapper">
           <div class="table-page-search-wrapper">
             <a-form-model
             <a-form-model
@@ -117,7 +162,6 @@
               :columns="columns1"
               :columns="columns1"
               :data="loadData1"
               :data="loadData1"
               :scroll="{ y: 450 }"
               :scroll="{ y: 450 }"
-              :defaultLoadData="false"
               :showPagination="false"
               :showPagination="false"
               bordered>
               bordered>
             </s-table>
             </s-table>
@@ -125,6 +169,8 @@
         </a-tab-pane>
         </a-tab-pane>
       </a-tabs>
       </a-tabs>
     </a-spin>
     </a-spin>
+    <!-- 销售记录 -->
+    <product-salesRecord-modal ref="salseRecord" :openModal="showRecord" @close="showRecord=false" />
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
@@ -132,10 +178,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
 import { STable } from '@/components'
 import ProductType from '../../common/productType.js'
 import ProductType from '../../common/productType.js'
-import { stockOutDetailList } from '@/api/stockOut'
+import productSalesRecordModal from './productSalesRecordModal.vue'
+import { queryWaitReplenish, queryShelfProduct } from '@/api/shelfReplenish'
 export default {
 export default {
   name: 'OutinDetailModal',
   name: 'OutinDetailModal',
-  components: { STable, ProductType },
+  components: { STable, ProductType, productSalesRecordModal },
   mixins: [commonMixin],
   mixins: [commonMixin],
   props: {
   props: {
     openModal: {
     openModal: {
@@ -154,31 +201,41 @@ export default {
     return {
     return {
       spinning: false,
       spinning: false,
       advanced: false,
       advanced: false,
+      showRecord: false,
       isShow: this.openModal, //  是否打开弹框
       isShow: this.openModal, //  是否打开弹框
       options: [
       options: [
-        { label: '库存充足', value: '1' },
-        { label: '部分缺货', value: '2' },
-        { label: '全部缺货', value: '3' }
+        { label: '库存充足', value: 'stockEnough' },
+        { label: '部分缺货', value: 'portionStockout' },
+        { label: '全部缺货', value: 'allStockout' }
       ],
       ],
+      curTab: 1,
       productType: [],
       productType: [],
       queryParam: {
       queryParam: {
         productCode: '', //  产品编码
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productName: '', //  产品名称
         productTypeSn1: '', //  产品一级分类
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        stockStateList: []
       },
       },
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.spinning = true
         this.spinning = true
-        return stockOutDetailList(Object.assign(parameter, this.queryParam)).then(res => {
+        this.queryParam.shelfSn = this.baseData.shelfSn
+        this.queryParam.customerSn = this.baseData.customerSn
+        this.queryParam.salePriceType = this.baseData.salePriceType
+        this.queryParam.salesBillSn = this.baseData.salesBillSn
+
+        return queryWaitReplenish(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           let data
           if (res.status == 200) {
           if (res.status == 200) {
             data = res.data
             data = res.data
             const no = 0
             const no = 0
             for (var i = 0; i < data.length; i++) {
             for (var i = 0; i < data.length; i++) {
+              data[i] = data[i].shelfProductApi
               data[i].no = no + i + 1
               data[i].no = no + i + 1
-              data[i].totalCost = Number(data[i].putCost * data[i].outQty).toFixed(2)
+              data[i].salesNums = data[i].replenishBillWaitQty
+              data[i].putCost = data[i].cost
             }
             }
           }
           }
           this.spinning = false
           this.spinning = false
@@ -198,14 +255,17 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData1: parameter => {
       loadData1: parameter => {
         this.spinning = true
         this.spinning = true
-        return stockOutDetailList(Object.assign(parameter, this.queryParam1)).then(res => {
+        this.queryParam1.shelfSn = this.baseData.shelfSn
+        this.queryParam1.customerSn = this.baseData.customerSn
+        this.queryParam1.salePriceType = this.baseData.salePriceType
+        this.queryParam1.salesBillSn = this.baseData.salesBillSn
+        return queryShelfProduct(Object.assign(parameter, this.queryParam1)).then(res => {
           let data
           let data
           if (res.status == 200) {
           if (res.status == 200) {
             data = res.data
             data = res.data
             const no = 0
             const no = 0
             for (var i = 0; i < data.length; i++) {
             for (var i = 0; i < data.length; i++) {
               data[i].no = no + i + 1
               data[i].no = no + i + 1
-              data[i].totalCost = Number(data[i].putCost * data[i].outQty).toFixed(2)
             }
             }
           }
           }
           this.spinning = false
           this.spinning = false
@@ -224,35 +284,34 @@ export default {
     columns () {
     columns () {
       const arr = [
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '库存批次', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次出库数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待补货数量', dataIndex: 'replenishBillWaitQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '门店库存数量', dataIndex: 'qplsStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'salePrice' }, width: '8%', align: 'center' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       ]
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
       return arr
     },
     },
     columns1 () {
     columns1 () {
       const arr = [
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '库存批次', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次出库数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       ]
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
       return arr
     }
     }
   },
   },
@@ -260,6 +319,11 @@ export default {
     cansel () {
     cansel () {
       this.isShow = false
       this.isShow = false
     },
     },
+    // 销售记录
+    handleDetail (row) {
+      this.showRecord = true
+      this.$refs.salseRecord.getDetail(this.baseData.customerSn, row.productSn, row)
+    },
     // 表格选中项
     // 表格选中项
     rowSelectionFun (obj) {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
       this.rowSelectionInfo = obj || null
@@ -270,8 +334,8 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
     },
-    onStockChange (val) {
-      console.log(val)
+    handleAdd (row) {
+      this.$emit('add', row)
     },
     },
     resetSearchForm () {
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productCode = ''
@@ -280,6 +344,7 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productTypeSn3 = ''
       this.productType = []
       this.productType = []
+      this.queryParam.stockStateList = []
       this.$refs.ruleForm.resetFields()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
@@ -312,7 +377,7 @@ export default {
         this.$emit('close')
         this.$emit('close')
       } else {
       } else {
         this.$nextTick(() => {
         this.$nextTick(() => {
-          this.$refs.table.refresh(true)
+          this.curTab = 1
         })
         })
       }
       }
     }
     }

+ 27 - 4
src/views/salesManagement/salesQuery/edit.vue

@@ -107,6 +107,7 @@
                   id="salesEdit-import">导入产品</a-button>
                   id="salesEdit-import">导入产品</a-button>
                 <a-button
                 <a-button
                   type="default"
                   type="default"
+                  v-if="shelfInfo&&shelfInfo.state=='ENABLE'"
                   @click="showShelfModal=true"
                   @click="showShelfModal=true"
                   id="salesEdit-shelf">货架产品</a-button>
                   id="salesEdit-shelf">货架产品</a-button>
                 <a-button
                 <a-button
@@ -138,6 +139,11 @@
               <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
               <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
             </a-tooltip>
             </a-tooltip>
           </div>
           </div>
+          <!-- 产品名称 -->
+          <template slot="productName" slot-scope="text, record">
+            <a-tag color="blue" v-if="record.shelfPlaceCode">{{ record.shelfPlaceCode }}</a-tag>
+            <span>{{ text }}</span>
+          </template>
           <!-- 产品编码 -->
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
           <template slot="productCode" slot-scope="text, record">
             <div v-if="detailData">
             <div v-if="detailData">
@@ -208,7 +214,13 @@
     <!-- 出库明细 -->
     <!-- 出库明细 -->
     <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
     <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
     <!-- 选择货架产品 -->
     <!-- 选择货架产品 -->
-    <chooseShelfProduct ref="chooseShelfProduct" :baseData="detailData" :openModal="showShelfModal" @close="showShelfModal=false"></chooseShelfProduct>
+    <chooseShelfProduct
+      v-if="showShelfModal"
+      ref="chooseShelfProduct"
+      @add="insterProduct"
+      :baseData="shelfInfo"
+      :openModal="showShelfModal"
+      @close="showShelfModal=false"></chooseShelfProduct>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -220,6 +232,7 @@ import chooseCustomModal from './chooseCustomModal.vue'
 import importGuideModal from './importGuideModal.vue'
 import importGuideModal from './importGuideModal.vue'
 import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
 import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
 import { stockByProductSn } from '@/api/stock'
 import { stockByProductSn } from '@/api/stock'
+import { queryByCustomerSn } from '@/api/shelf'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
 import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import outInDetialModal from '@/views/common/outInDetialModal.vue'
@@ -276,7 +289,8 @@ export default {
         })
         })
       },
       },
       printerType: 'NEEDLE', //  打印机类型
       printerType: 'NEEDLE', //  打印机类型
-      isCosts: false // 是否显示成本价
+      isCosts: false, // 是否显示成本价
+      shelfInfo: null // 是否有货架
     }
     }
   },
   },
   computed: {
   computed: {
@@ -292,7 +306,7 @@ export default {
       const arr = [
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', scopedSlots: { customRender: 'productName' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         // { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         // { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
@@ -567,7 +581,7 @@ export default {
       if (this.dataSource && this.dataSource.length > 0) {
       if (this.dataSource && this.dataSource.length > 0) {
         const hasRow = this.dataSource.find(item => item.productSn == row.productSn)
         const hasRow = this.dataSource.find(item => item.productSn == row.productSn)
         if (hasRow) {
         if (hasRow) {
-          // this.$message.info('该产品已在当前销售单中存在!')
+          this.$message.info('该产品已在当前销售单中存在!')
           this.productForm = {
           this.productForm = {
             productName: '',
             productName: '',
             productCode: hasRow.dealerProductEntity && hasRow.dealerProductEntity.code || '',
             productCode: hasRow.dealerProductEntity && hasRow.dealerProductEntity.code || '',
@@ -654,10 +668,19 @@ export default {
             const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
             const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
             const priceType = vm.$route.params.priceType
             const priceType = vm.$route.params.priceType
             vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
             vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
+            // 查询关联的客户
+            if (vm.detailData && vm.detailData.buyerSn) {
+              this.getShelfQueryByCustomer()
+            }
           }
           }
         }
         }
       })
       })
     },
     },
+    getShelfQueryByCustomer () {
+      queryByCustomerSn({ sn: this.detailData.buyerSn }).then(res => {
+        this.shelfInfo = Object.assign(res.data, { salePriceType: this.$route.params.priceType, salesBillSn: this.salesBillSn })
+      })
+    },
     // 提交销售单
     // 提交销售单
     handleSubmit (params) {
     handleSubmit (params) {
       this.spinning = true
       this.spinning = true

+ 1 - 1
vue.config.js

@@ -211,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        target: 'http://192.168.0.182:8503/qpls-md',
+        target: 'http://192.168.0.215:8503/qpls-md',
         // target: 'http://p.iscm.360arrow.com/qpls-md',
         // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         // ws: false,
         ws: true,
         ws: true,