lilei 4 yıl önce
ebeveyn
işleme
09a869471d

+ 34 - 70
src/api/sales.js

@@ -1,24 +1,22 @@
 import { axios } from '@/utils/request'
 
-//  销售 列表  有分页
-export const salesList = (params) => {
-  const url = `/sales/queryPage/${params.pageNo}/${params.pageSize}`
-  delete params.pageNo
-  delete params.pageSize
+//  销售 审核
+export const salesWriteAudit = (params) => {
   return axios({
-    url: url,
+    url: '/sales/audit',
     data: params,
     method: 'post'
   })
 }
-//  销售 详情
-export const salesDetail = (params) => {
+
+//  销售 删除
+export const salesDel = (params) => {
   return axios({
-    url: `/sales/findById/${params.id}`,
-    data: params,
+    url: `/sales/delete/${params.salesBillSn}`,
     method: 'get'
   })
 }
+
 //  销售 详情bysn
 export const salesDetailBySn = (params) => {
   return axios({
@@ -27,6 +25,16 @@ export const salesDetailBySn = (params) => {
     method: 'get'
   })
 }
+
+//  销售 新增或编辑
+export const salesSave = (params) => {
+  return axios({
+    url: '/sales/insert',
+    data: params,
+    method: 'post'
+  })
+}
+
 //  销售 打印
 export const salesPrint = (params) => {
   return axios({
@@ -35,6 +43,7 @@ export const salesPrint = (params) => {
     method: 'post'
   })
 }
+
 //  销售 打印预览
 export const salesPrintPreview = (params) => {
   return axios({
@@ -43,53 +52,28 @@ export const salesPrintPreview = (params) => {
     method: 'post'
   })
 }
-//  销售 冲减
-export const salesWriteDown = (params) => {
-  return axios({
-    url: '/sales/writeDown',
-    data: params,
-    method: 'post'
-  })
-}
-//  销售 审核
-export const salesWriteAudit = (params) => {
-  return axios({
-    url: '/sales/audit',
-    data: params,
-    method: 'post'
-  })
-}
-//  销售 折扣
-export const salesWriteDiscount = (params) => {
-  return axios({
-    url: '/sales/discount',
-    data: params,
-    method: 'post'
-  })
-}
-//  销售 备货审核
-export const salesWritePrepareAudit = (params) => {
+
+// 销售 统计查询
+export const salesCount = (params) => {
   return axios({
-    url: '/sales/prepareAudit',
+    url: `/sales/queryCount`,
     data: params,
     method: 'post'
   })
 }
-//  销售 收款
-export const salesWriteReceipt = (params) => {
+
+//  销售 列表  有分页
+export const salesList = (params) => {
+  const url = `/sales/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: '/sales/receipt',
+    url: url,
     data: params,
     method: 'post'
   })
 }
-//  销售 出库
-export const salesWriteStockOut = (params) => {
-  return axios({
-    url: `/sales/stockOut/${params.salesBillSn}`,
-    method: 'get'
-  })
-}
+
 //  销售 提交
 export const salesWriteSubmit = (params) => {
   return axios({
@@ -98,28 +82,8 @@ export const salesWriteSubmit = (params) => {
     method: 'get'
   })
 }
-//  销售 新增或编辑
-export const salesSave = (params) => {
-  return axios({
-    url: '/sales/insert',
-    data: params,
-    method: 'post'
-  })
-}
 
-//  销售 删除
-export const salesDel = (params) => {
-  return axios({
-    url: `/sales/delete/${params.salesBillSn}`,
-    method: 'get'
-  })
-}
 
-// 销售 统计
-export const salesCount = (params) => {
-  return axios({
-    url: `/sales/queryCount`,
-    data: params,
-    method: 'post'
-  })
-}
+
+
+

+ 46 - 7
src/api/salesDetail.js

@@ -1,6 +1,42 @@
 import { axios } from '@/utils/request'
 
-//  销售详情 列表  分页
+//  销售详情 删除
+export const salesDetailDel = (params) => {
+  return axios({
+    url: `/sales/detail/delete`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 一键发货
+export const salesDetailDispatchByOneKey = (params) => {
+  return axios({
+    url: `/sales/detail/dispatchByOneKey/${params.salesBillSn}`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 新增销售明细
+export const salesDetailInsert = (params) => {
+  return axios({
+    url: '/sales/detail/insert',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 批量新增代发货信息
+export const insertBatchOfWaitDispatch = (params) => {
+  return axios({
+    url: '/sales/detail/insertBatchOfWaitDispatch',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 销售详情列表分页
 export const salesDetailList = (params) => {
   const url = `/sales/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
@@ -11,22 +47,25 @@ export const salesDetailList = (params) => {
     method: 'post'
   })
 }
-//  销售详情 保存
-export const salesDetailSave = (params) => {
+
+// 修改销售明细取消数量
+export const salesDetailUpdateCancelQty = (params) => {
   return axios({
-    url: '/sales/detail/insert',
+    url: '/sales/detail/updateCancelQty',
     data: params,
     method: 'post'
   })
 }
-//  销售详情 删除
-export const salesDetailDel = (params) => {
+
+//  修改销售明细数量
+export const salesDetailUpdateQty = (params) => {
   return axios({
-    url: `/sales/detail/delete`,
+    url: '/sales/detail/updateQty',
     data: params,
     method: 'post'
   })
 }
+
 //  销售详情 整单删除
 export const salesDetailDelAll = (params) => {
   return axios({

+ 1 - 1
src/views/common/editInput.js

@@ -1,6 +1,6 @@
 const EditableCell = {
   template: `
-      <div style="display:flex;align-items: center;">
+      <div style="display:flex;align-items: center;justify-content: center;">
         <span>
         {{punit}} 
         </span>

+ 77 - 128
src/views/salesManagement/salesQuery/edit.vue

@@ -14,61 +14,54 @@
       </template>
     </a-page-header>
     <a-card size="small" :bordered="false" class="salesEdit-cont">
+      <div slot="title">
+        <div class="p-title">
+          选择产品
+        </div>
+      </div>
       <!-- 查询配件列表 -->
       <queryPart ref="partQuery" :buyerSn="detailData&&detailData.buyerSn" :priceType="$route.params.priceType" :newLoading="isInster" @add="insterProduct"></queryPart>
     </a-card>
-    <a-card size="small" :bordered="false" class="salesEdit-cont">
+    <a-card :bordered="false" class="salesEdit-cont">
+      <div slot="title">
+        <a-row :gutter="15" type="flex">
+          <a-col :span="2">
+            <div class="p-title">
+              已选产品
+            </div>
+          </a-col>
+          <a-col :span="16">
+            <div class="p-notes">
+              <a-icon style="color: #FF9900;" type="bell" /> 已选产品可参加<span>【买10副刹车片送2个滤清器】、【买电瓶送滤清器】</span>的促销活动,促销产品为指定产品
+            </div>
+          </a-col>
+          <a-col :span="6">
+            <div style="float:right;overflow: hidden;">
+              <a-button size="small" id="salesEdit-dru">导入明细</a-button>
+              <a-button
+                size="small"
+                type="primary"
+                @click="delSalerDetailAll"
+                :loading="delLoading"
+                style="margin-left: 10px"
+                id="salesEdit-del-all">整单删除</a-button>
+            </div>
+          </a-col>
+        </a-row>
+      </div>
       <!-- 总计 -->
-      <a-alert style="margin-bottom: 15px;" type="info">
+      <a-alert type="info">
         <div slot="message" class="total-bar">
           <div>
             总售价:<strong>¥{{ detailData&&detailData.totalAmount || 0 }}</strong>;
             总款数:<strong>{{ detailData&&detailData.totalCategory || 0 }}</strong>;
             总数量:<strong>{{ detailData&&detailData.totalQty || 0 }}</strong>;
-            赠品总数量:<strong>{{ detailData&&detailData.giftQty || 0 }}</strong>;
           </div>
           <div>
-            <div>
-              折扣金额:
-              <a-input-number id="discount" v-model="detailData.discountAmount" :min="0" :precision="2" :max="999999"/>
-              <a-button type="primary" @click="salesDiscount" class="button-info">打折</a-button>
-            </div>
-            <div>
-              折扣:<strong>{{ detailData&&detailData.discountRate || 0 }}%</strong>;
-              折后总售价:<strong>¥{{ detailData&&detailData.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" allowClear placeholder="输入产品编码" />
-            </a-form-model-item>
-            <a-form-model-item label="产品名称">
-              <a-input v-model="productForm.productName" allowClear 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="salesEdit-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesEdit-reset">重置</a-button>
-            </a-form-model-item>
-          </a-form-model>
-        </a-col>
-        <a-col :span="6">
-          <div style="float:right;overflow: hidden;">
-            <a-button size="small" id="salesEdit-dru">导入明细</a-button>
-            <a-button
-              size="small"
-              type="primary"
-              @click="delSalerDetailAll"
-              :loading="delLoading"
-              style="margin-left: 10px"
-              id="salesEdit-del-all">整单删除</a-button>
-          </div>
-        </a-col>
-      </a-row>
+
       <!-- 已选配件列表 -->
       <s-table
         class="sTable"
@@ -77,34 +70,21 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1560, y: 300 }"
-        :rowClassName="(record, index) => record.cost > record.price ? 'redBg-row':''"
+        :scroll="{ y: 300 }"
         bordered>
-        <!-- 产品编码 -->
-        <template slot="productCode" slot-scope="text, record">
-          <a-badge count="" v-if="record.oosFlag == 1">
+        <!-- 产品名称 -->
+        <template slot="productName" slot-scope="text, record">
+          <a-badge count="活动" v-if="record.oosFlag == 1">
             <div style="padding-right: 15px;">{{ text }}</div>
           </a-badge>
           <span v-else>{{ text }}</span>
         </template>
-        <!-- 售价 -->
-        <template slot="price" slot-scope="text, record">
-          <editable-cell
-            size="small"
-            :text="text"
-            id="salesEdit-price"
-            :max="999999"
-            :min="0"
-            :precision="2"
-            punit="¥"
-            @change="onCellChange(record.id, 'price', $event)" />
-        </template>
+
         <!-- 销售数量 -->
         <template slot="salesNums" slot-scope="text, record">
           <editable-cell
             size="small"
             :text="record.qty"
-            id="salesEdit-salesNums"
             :max="999999"
             :min="1"
             :precision="0"
@@ -118,7 +98,14 @@
             :loading="delLoading"
             class="button-error"
             @click="handleDel(record)"
-            id="productInfoList-Del">删除</a-button>
+          >删除</a-button>
+          <a-button
+            size="small"
+            type="primary"
+            :loading="delLoading"
+            class="button-warning"
+            @click="handleSelCx(record)"
+          >选择促销品</a-button>
         </template>
       </s-table>
     </a-card>
@@ -135,7 +122,7 @@
       </div>
     </a-affix>
     <!-- 选择客户弹框 -->
-    <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
+    <choose-custom-modal ref="custModal" :show="openModal" @cancel="openModal=false" />
   </div>
 </template>
 
@@ -143,15 +130,14 @@
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
-import { salesDetail, salesWriteSubmit, salesWriteDiscount } from '@/api/sales'
+import { salesDetailBySn, salesWriteSubmit } from '@/api/sales'
 import EditableCell from '@/views/common/editInput.js'
-import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
+import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   components: { STable, VSelect, queryPart, chooseCustomModal, EditableCell },
   data () {
     return {
-      orderId: null, // 销售单id
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
@@ -160,24 +146,18 @@ export default {
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
       productForm: {
-        productName: '',
-        productCode: ''
+        salesBillSn: ''
       },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', scopedSlots: { customRender: 'productCode' }, width: 140, align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseEntity.name', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: 140, align: 'center', sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', width: 150, align: 'center' },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '折后小计', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -205,21 +185,11 @@ export default {
         row[key] = Number(value)
         this.dataSource = dataSource
       }
-      // 修改价格
-      if (key == 'price') {
-        salesDetailUpdatePrice({
-          salesBillSn: row.salesBillSn,
-          productSn: row.productSn,
-          price: row.price
-        }).then(res => {
-          this.resetSearchForm(true)
-          this.$message.info(res.message)
-        })
-      }
       if (key == 'qty') {
         salesDetailUpdateQty({
-          id: row.id,
-          qty: row.qty
+          salesBillDetailSn: row.salesBillDetailSn,
+          qty: row.qty,
+          salesBillSn: this.salesBillSn
         }).then(res => {
           this.resetSearchForm(true)
           if (res.status == 200) {
@@ -236,15 +206,6 @@ export default {
         this.$refs.custModal.editCust(this.detailData)
       }, 500)
     },
-    // 更新产品列表
-    updateData (priceType) {
-      // 价格类型变更
-      if (priceType != this.$route.params.priceType) {
-        this.$router.push({ name: 'salesEdit', params: { id: this.orderId, sn: this.salesBillSn, priceType: priceType } })
-      } else {
-        this.getOrderDetail()
-      }
-    },
     //  重置
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
@@ -252,32 +213,12 @@ export default {
     },
     // 重置列表
     resetForm () {
-      this.productForm = {
-        productName: '',
-        productCode: ''
-      }
       this.$refs.table.refresh()
     },
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesQueryList' })
     },
-    // 打折
-    salesDiscount () {
-      if (this.detailData.discountAmount < 0) {
-        return
-      }
-      console.log(this.detailData)
-      salesWriteDiscount({
-        discountAmount: this.detailData.discountAmount,
-        salesBillSn: this.detailData.salesBillSn,
-        id: this.detailData.id
-      }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm()
-        }
-      })
-    },
     // 整单删除
     delSalerDetailAll () {
       const _this = this
@@ -288,11 +229,11 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
-          salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
+          salesDetailDelAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm()
+              _this.$message.success(res.message)
             }
-            _this.$message.info(res.message)
             _this.delLoading = false
           })
         }
@@ -308,11 +249,11 @@ export default {
         closable: true,
         onOk () {
           _this.delLoading = true
-          salesDetailDel({ id: row.id }).then(res => {
+          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.resetSearchForm(true)
+              _this.$message.success(res.message)
             }
-            _this.$message.info(res.message)
             _this.delLoading = false
           })
         }
@@ -365,8 +306,6 @@ export default {
         buyerSn: this.detailData.buyerSn,
         productSn: row.productSn,
         cost: row.putCost,
-        // productCode: row.productCode,
-        // productOrigCode: row.productOrigCode,
         price: row.salePrice,
         qty: row.salesNums,
         salesBillSn: this.detailData.salesBillSn,
@@ -385,7 +324,7 @@ export default {
     },
     //  销售单详情
     getOrderDetail () {
-      salesDetail({ id: this.$route.params.id }).then(res => {
+      salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
         console.log('getOrderDetail')
         if (res.status == 200) {
           this.detailData = res.data
@@ -395,7 +334,7 @@ export default {
     },
     // 提交销售单
     handleSubmit () {
-      salesWriteSubmit({ id: this.orderId }).then(res => {
+      salesWriteSubmit({ salesBillSn: this.salesBillSn }).then(res => {
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
@@ -405,12 +344,11 @@ export default {
   },
   mounted () {
     this.getOrderDetail()
-    this.orderId = this.$route.params.id
-    this.salesBillSn = this.$route.params.sn
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
       console.log('beforeRouteEnter')
+      vm.salesBillSn = vm.$route.params.sn
     })
   }
 }
@@ -421,6 +359,17 @@ export default {
     .salesEdit-cont{
       margin-top: 15px;
     }
+    .sTable{
+      margin-top: 15px;
+    }
+    .p-title{
+      font-weight: bold;
+    }
+    .p-notes{
+      span{
+        color: #FF9900;
+      }
+    }
     .total-bar{
       display: flex;
       align-items: center;

+ 0 - 2
src/views/salesManagement/salesQuery/list.vue

@@ -222,8 +222,6 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '区域', dataIndex: 'shippingAddrCountyName', width: 120, align: 'center' },
-        { title: '省份', dataIndex: 'shippingAddrProvinceName', width: 120, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 120, align: 'center' },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 210, align: 'center' },

+ 9 - 211
src/views/salesManagement/salesQuery/queryPart.vue

@@ -20,56 +20,14 @@
             </a-form-item>
           </a-col>
           <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="车架号(VIN)">
-                <a-input id="productInfoList-vinNo" v-model.trim="queryParam.vinNo" allowClear placeholder="请输入车架号(VIN)"/>
-              </a-form-item>
-            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <a-select
-                  placeholder="请选择产品品牌"
-                  id="productInfoList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.brandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+                <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品类别">
-                <a-cascader
-                  @change="changeProductType"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="车型">
-                <v-select code="CHECK_ENABLE_STATE" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择车型"></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="仓库">
-                <a-select
-                  placeholder="请选择仓库"
-                  id="productInfoList-warehouseSn"
-                  allowClear
-                  v-model="queryParam.warehouseSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                </a-select>
+                <ProductType id="productInfoList-productType" v-model="productType" @change="changeProductType"></ProductType>
               </a-form-item>
             </a-col>
           </template>
@@ -84,10 +42,6 @@
               <template slot="content">双击列表配件可快速选中添加</template>
               <a-icon type="question-circle" theme="twoTone" />
             </a-popover>
-            <a-popover>
-              <template slot="content">点击设置列的显示</template>
-              <a-icon style="margin:0 15px;cursor: pointer;" @click="showSetting = true" type="setting" theme="twoTone" />
-            </a-popover>
           </a-col>
         </a-row>
       </a-form>
@@ -104,19 +58,6 @@
       :scroll="{ x: tableWidth, y: 300 }"
       :defaultLoadData="false"
       bordered>
-      <!-- 售价 -->
-      <template slot="salePrice" slot-scope="text, record">
-        <div @dblclick.stop>
-          ¥
-          <a-input-number
-            size="small"
-            v-model="record.salePrice"
-            :precision="2"
-            :min="0"
-            :max="999999"
-            placeholder="请输入" />
-        </div>
-      </template>
       <!-- 销售数量 -->
       <template slot="nums" slot-scope="text, record">
         <div @dblclick.stop>
@@ -138,48 +79,20 @@
           :loading="newLoading"
           @click="handleAdd(record)"
           id="productInfoList-edit-btn">添加</a-button>
-        <a-button
-          size="small"
-          type="primary"
-          class="button-success"
-          @click="handleDetail(record)"
-          id="productInfoList-detail-btn"
-          style="margin-left: 15px;">销售记录</a-button>
       </template>
     </s-table>
-    <!-- 销售记录 -->
-    <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="closeModal" />
-    <!-- 设置列 -->
-    <a-modal
-      v-model="showSetting"
-      title="设置要显示的列"
-      centered
-      :footer="null"
-      @ok="() => (showSetting = false)"
-    >
-      <a-checkbox-group v-model="settingColVal" @change="onSettingChange">
-        <a-row>
-          <a-col :span="8" v-for="item in settingColList" :key="item.value">
-            <a-checkbox :value="item.value">
-              {{ item.label }}
-            </a-checkbox>
-          </a-col>
-        </a-row>
-      </a-checkbox-group>
-    </a-modal>
   </div>
 </template>
 
 <script>
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-// import { dealerProductTypeList } from '@/api/dealerProductType'
 import { querySumByProductLocation } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
-import productSalesRecordModal from './productSalesRecordModal.vue'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
-  components: { STable, VSelect, productSalesRecordModal },
+  components: { STable, VSelect, ProductBrand, ProductType },
   props: {
     buyerSn: {
       type: [Number, String],
@@ -196,17 +109,6 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
       tableWidth: 0,
-      settingColVal: ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit'],
-      settingColList: [
-        { label: '原厂编码', value: 'productOrigCode' },
-        { label: '品牌', value: 'brandName' },
-        { label: '仓库', value: 'warehouseName' },
-        { label: '仓位', value: 'warehouseLocationName' },
-        { label: '库存数量', value: 'currentQty' },
-        { label: '单位', value: 'unit' },
-        { label: '成本价', value: 'putCost' },
-        { label: '市级价', value: 'dealerProduct.cityPrice' }
-      ],
       productType: [],
       queryParam: { //  查询条件
         salePriceType: '',
@@ -216,48 +118,27 @@ export default {
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '', //  产品三级分类
-        warehouseSn: undefined //  仓库
+        productTypeSn3: '' //  产品三级分类
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
-      productBrandList: [], //  下拉数据
-      productTypeList: [], //  产品类别  下拉数据
-      warehouseList: [], // 仓库列表
-      columnsBak: [
+      columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
-        { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
         { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 150, align: 'center' },
+        { title: '包装数', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
-      columns: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.queryParam.salePriceType = this.priceType
-        // 排序
-        if (parameter.sortField == 'productCode') {
-          parameter.sortField = 'code'
-          parameter.sortAlias = 'product '
-        }
-        if (parameter.sortField == 'brandName') {
-          parameter.sortField = 'firstChar'
-          parameter.sortAlias = 'brand'
-        }
-        if (parameter.sortField == 'warehouseName') {
-          parameter.sortField = 'warehouseSn'
-          parameter.sortAlias = 'sd'
-        }
         return querySumByProductLocation(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           data.list = data.list.filter(item => item != null)
@@ -270,48 +151,10 @@ export default {
           this.disabled = false
           return data
         })
-      },
-      openModal: false //  查看客户详情  弹框
-    }
-  },
-  created () {
-    this.columns = this.columnsBak
-    this.onSettingChange()
-    // 产品品牌
-    if (this.productBrandList.length == 0) {
-      this.getProductBrand()
-    }
-    // 产品分类
-    if (this.productTypeList.length == 0) {
-      this.getProductType()
-    }
-    // 仓库
-    if (this.warehouseList.length == 0) {
-      this.getWarehouse()
+      }
     }
   },
   methods: {
-    // 设置列
-    onSettingChange (v) {
-      const k = ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit', 'putCost', 'dealerProduct.cityPrice']
-      const a = ['no', 'productCode', 'productName']
-      const b = ['salePrice', 'salesNums', 'action']
-      const c = this.settingColVal
-      const q = k.filter(item => c.indexOf(item) >= 0)
-      const r = a.concat(q).concat(b)
-      const d = []
-      let w = 0
-      for (let i = 0; i < r.length; i++) {
-        const row = this.columnsBak.find(item => item.dataIndex == r[i])
-        if (row) {
-          w = w + row.width
-          d.push(row)
-        }
-      }
-      console.log(w)
-      this.tableWidth = w
-      this.columns = d
-    },
     // 双击列表
     handleClickRow (record) {
       const _this = this
@@ -333,7 +176,6 @@ export default {
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
-      this.queryParam.warehouseSn = undefined
       this.productType = []
       this.$refs.table.refresh(true)
     },
@@ -341,54 +183,10 @@ export default {
     resetCurForm () {
       this.$refs.table.refresh()
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     // 选择配件
     handleAdd (row) {
       this.$emit('add', row)
     },
-    // 销售记录
-    handleDetail (row) {
-      this.openModal = true
-      this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn)
-    },
-    //  关闭弹框
-    closeModal () {
-      this.openModal = false
-    },
-    // 仓库
-    getWarehouse () {
-      warehouseAllList({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
-    //  产品品牌  列表
-    getProductBrand () {
-      dealerProductBrandQuery({ sysFlag: 0 }).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''