lilei hai 6 meses
pai
achega
d4d30a19b4

+ 7 - 1
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -8,7 +8,9 @@
     :get-container="false"
     :wrap-style="{ position: 'absolute' }"
     :headerStyle="{ padding: '10px' }"
-    wrapClassName="chooseProducts-modal">
+    wrapClassName="chooseProducts-modal"
+    @close="isShow=false"
+  >
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="products-con">
         <div>
@@ -105,6 +107,10 @@ export default {
 
 <style lang="less" scoped>
   .chooseProducts-modal{
+    .ant-drawer-close{
+      height: 43px;
+      line-height: 43px;
+    }
     .products-con{
       .btn-con{
         text-align: center;

+ 55 - 48
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -141,6 +141,7 @@
         :table-data="dataSource"
         row-key-field-name="id"
         :checkbox-option="checkboxOption"
+        :cell-style-option="cellStyleOption"
       />
       <div v-show="dataSource.length==0" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
     </a-spin>
@@ -224,6 +225,13 @@ export default {
         // column resize min width
         minWidth: 50
       },
+      cellStyleOption: {
+        headerCellClass: ({ column, rowIndex }) => {
+          if (column.align != 'center') {
+            return 'table-header-cell-center'
+          }
+        }
+      },
       dataSource: [],
       showSearchBox: true, // 是否显示筛选条件
       openWarehouseModal: false, // 打开仓库设置
@@ -289,14 +297,14 @@ export default {
         return data || data == 0 ? data : '--'
       }
       const arr = [
-        { title: '', field: '', key: '0', width: 40, type: 'checkbox', align: 'center' },
-        { title: '序号', field: 'no', key: '1', width: 50, align: 'center', operationColumn: false },
+        { title: '', field: '', key: '0', width: 30, type: 'checkbox', align: 'center' },
+        { title: '序号', field: 'no', key: '1', width: 30, align: 'center', operationColumn: false },
         {
           title: '产品编码',
           field: 'productCode',
           key: '2',
-          align: 'center',
-          width: 120,
+          align: 'left',
+          width: 100,
           operationColumn: false,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
             return (
@@ -311,12 +319,32 @@ export default {
             )
           }
         },
-        { title: '产品名称', field: 'productName', key: '3', width: 150, align: 'center', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.productEntity.name || '--' } },
+        {
+          title: '产品名称',
+          field: 'productName',
+          key: '3',
+          width: 150,
+          align: 'left',
+          operationColumn: false,
+          ellipsis: { showTitle: true },
+          renderBodyCell: ({ row, column, rowIndex }, h) => {
+            return (
+              <div class="ellipsisCon">
+                <a-tooltip placement="rightBottom">
+                  <template slot="title">
+                    <span>{ row.productEntity.name || '--' }</span>
+                  </template>
+                  <span class="ellipsisText">{ row.productEntity.name || '--' }</span>
+                </a-tooltip>
+              </div>
+            )
+          }
+        },
         {
           title: '规则数量',
           field: 'rulesNums',
           key: '4',
-          width: 60,
+          width: 50,
           align: 'center',
           operationColumn: false,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
@@ -339,7 +367,7 @@ export default {
                 </a-popover> : '--'
             )
           } },
-        { title: '起订量', field: 'promoUnit', key: '5', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '起订量', field: 'promoUnit', key: '5', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
         {
           title: '销售数量',
           field: 'salesNums',
@@ -388,7 +416,7 @@ export default {
         {
           title: '出库仓库',
           field: 'warehouseBox',
-          width: 100,
+          width: 80,
           key: '8',
           align: 'center',
           operationColumn: false,
@@ -417,7 +445,7 @@ export default {
         {
           title: '操作',
           field: 'action',
-          width: 100,
+          width: 80,
           key: 'action',
           align: 'center',
           fixed: 'right',
@@ -452,23 +480,28 @@ export default {
           }
         }
       ]
-      if (this.showStockCol) {
-        arr.splice(7, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
-      }
       // 售价权限
-      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
-        arr.splice(4, 0, { title: '售价(原价)',
+      if (_this.$hasPermissions('B_salesEdit_salesPrice')) {
+        arr.splice(4, 0, {
+          title: '售价(原价)',
           field: 'price',
-          width: 120,
+          width: 100,
           key: 'price',
-          align: 'center',
+          align: 'right',
           operationColumn: false,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
             return <div>{_this.toThousands(row[column.field])}<span style="color:#666;margin-left:3px;" title="原价">({_this.toThousands(row.origPrice)})</span></div>
           }
         })
-        arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 80, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
-        arr.splice((_this.showStockCol ? 10 : 9), 0, { title: '售价小计', field: 'totalAmount', key: 'totalAmount', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+        arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 60, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
+        if (_this.showStockCol) {
+          arr.splice(10, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
+        arr.splice((_this.showStockCol ? 11 : 10), 0, { title: '售价小计', field: 'totalAmount', key: 'totalAmount', width: 60, align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+      } else {
+        if (_this.showStockCol) {
+          arr.splice(8, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
       }
       return arr
     }
@@ -557,8 +590,8 @@ export default {
     },
     // 查询第三方库存
     searchThreeStockOk () {
-      this.showStockCol = true
       this.resetSearchForm()
+      this.showStockCol = true
     },
     // 表格选中项
     rowSelectionFun (obj) {
@@ -585,7 +618,6 @@ export default {
       this.rowSelectionInfo = null
       this.getTableData()
       this.clearTableSelect()
-      this.showStockCol = false
     },
     // 查询产品,不重置
     searchProduct () {
@@ -928,36 +960,11 @@ export default {
       position: absolute;
       bottom: 50px;
       width: 100%;
+  }
+  .table-header-cell-center{
+    text-align: center!important;
   }
    .ant-input-number-sm input{
     text-align: center;
    }
-   .alert-bar{
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .countData{
-      span{
-        margin: 0 2px;
-        color: rgb(0, 153, 255);
-      }
-      span.cor1{
-        color: rgb(248, 132, 0);
-      }
-      b{
-        font-weight: bold;
-        span{
-          color: red;
-          font-weight: normal;
-        }
-      }
-    }
-    > div{
-      &:first-child{
-        flex-grow: 1;
-        width:70%;
-        padding-right: 100px;
-      }
-    }
-   }
 </style>

+ 13 - 14
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -110,7 +110,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :row-selection="{ columnWidth: 40 }"
+      :row-selection="{ columnWidth: 30 }"
       @rowSelection="rowSelectionFun"
       :pageSize="showTotal?10:30"
       :defaultLoadData="false"
@@ -131,7 +131,6 @@
             </template>
             <span class="ellipsisText">{{ text }}</span>
           </a-tooltip>
-          <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
         </div>
       </template>
       <!-- 销售数量 -->
@@ -334,23 +333,23 @@ export default {
     // 表格列定义
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '12%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
-        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '7%', align: 'center' },
-        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '7%', align: 'center' },
-        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '序号', dataIndex: 'no', width: '40px', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '100px', align: 'left' },
+        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '150px', align: 'left' },
+        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '100px', align: 'center' },
+        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '100px', align: 'center' },
+        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '100px', align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
       ]
       if (this.showStockCol) {
-        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '8%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '100px', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
       }
       // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) {
-        arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.splice(this.showStockCol ? 8 : 7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(this.showStockCol ? 8 : 7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }