Browse Source

销售 更新

chenrui 3 năm trước cách đây
mục cha
commit
6d6147f8d9

+ 11 - 0
src/api/salesDetail.js

@@ -71,6 +71,17 @@ export const salesDetailAllStockList = (params) => {
     method: 'post'
   })
 }
+// 销售列表  分页  带库存
+export const salesDetailStockList = (params) => {
+  const url = `/sales/detail/queryPageStock/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 // 修改销售明细取消数量
 export const salesDetailUpdateCancelQty = (params) => {
   return axios({

+ 2 - 2
src/components/Table/index.js

@@ -123,6 +123,7 @@ export default {
     this.localPagination = ['auto', true].includes(this.showPagination) && Object.assign({}, this.localPagination, {
       current: localPageNum,
       pageSize: this.pageSize,
+      pageSizeOptions: ['5', '10', '20', '30', '40'],
       showTotal: total => `共 ${total} 条记录`,
       showSizeChanger: this.showSizeChanger
     }) || false
@@ -139,9 +140,8 @@ export default {
      * @param Boolean bool
      */
     refresh (bool = false) {
-      console.log(this.showSizeChanger, '-----showSizeChanger', this.pageSize)
       bool && (this.localPagination = Object.assign({}, {
-        current: 1, pageSize: this.pageSize, showSizeChanger: this.showSizeChanger
+        current: 1, pageSize: this.pageSize
       }))
       this.loadData()
     },

+ 5 - 1
src/views/common/auditModal.vue

@@ -12,7 +12,7 @@
         <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
         <div class="audit-cont">
           <p class="audit-tit">提示</p>
-          <p class="audit-txt">请点击下方按钮确认操作?</p>
+          <p class="audit-txt">{{ content || '请点击下方按钮确认操作?' }}</p>
         </div>
       </div>
       <div class="btn-box">
@@ -31,6 +31,10 @@ export default {
       type: Boolean,
       default: false
     },
+    content: {
+      type: String,
+      default: '请点击下方按钮确认操作?'
+    },
     spinning: {
       type: Boolean,
       default: false

+ 97 - 49
src/views/salesManagement/salesQuery/detail.vue

@@ -103,62 +103,87 @@
           bordered>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
-            <a-badge count="促" v-if="record.promotionFlag == 1">
-              <div style="padding-right: 15px;">{{ text }}</div>
-            </a-badge>
-            <!-- 可审核时才可显示“缺”货产品 -->
-            <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))">
-              <div style="padding-right: 15px;">{{ text }}</div>
-            </a-badge>
+            <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))" class="flexBox">
+              <div>{{ text }}</div>
+              <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1">
+              </a-badge>
+              <!-- 可审核时才可显示“缺”货产品 -->
+              <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))">
+              </a-badge>
+            </div>
             <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
           </template>
           <!-- 当前库存 -->
           <template slot="stockQty" slot-scope="text, record">
-            <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty) - Number(record.stockQty) }}</span>)</p>
-            <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
+            <div v-if="record.stockQty || record.stockQty==0">
+              <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty) - Number(record.stockQty) }}</span>)</p>
+              <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
+            </div>
+            <span v-else>--</span>
           </template>
         </s-table>
       </a-card>
-      <a-card size="small" :bordered="false" class="footer-cont">
-        <a-button
-          type="primary"
-          class="button-info"
-          size="large"
-          style="width: 150px;"
-          id="salesDetail-edit-btn"
-          v-if="detailData&&detailData.salesBillSource != 'PURCHASE' && (detailData.billStatus == 'WAIT_SUBMIT' || detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')"
-          @click="handleEdit()"
-        >
-          编辑
-        </a-button>
-        <a-button
-          size="large"
-          style="width: 150px;"
-          type="primary"
-          class="button-info"
-          id="salesDetail-edit-btn"
-          v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
-          @click="handleEdit()"
-        >
-          改单
-        </a-button>
-        <a-button
-          size="large"
-          style="width: 150px;"
-          type="primary"
-          class="button-warning"
-          id="salesDetail-audit-btn"
-          v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
-          @click="visibleAudit=true"
-        >
-          审核
-        </a-button>
-      </a-card>
     </a-spin>
+    <div class="affix-cont">
+      <a-button
+        size="large"
+        style="width: 150px;font-size: 12px;"
+        :disabled="spinning"
+        type="primary"
+        class="button-error"
+        id="salesDetail-batchAudit-btn"
+        v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
+        @click="handleAudit('batch')"
+      >
+        一键审核
+      </a-button>
+      <a-button
+        type="primary"
+        :disabled="spinning"
+        class="button-info"
+        size="large"
+        style="width: 150px;"
+        id="salesDetail-edit-btn"
+        v-if="detailData&&detailData.salesBillSource != 'PURCHASE' && (detailData.billStatus == 'WAIT_SUBMIT' || detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')"
+        @click="handleEdit()"
+      >
+        编辑
+      </a-button>
+      <a-button
+        size="large"
+        style="width: 150px;"
+        :disabled="spinning"
+        type="primary"
+        class="button-info"
+        id="salesDetail-edit-btn"
+        v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
+        @click="handleEdit()"
+      >
+        改单
+      </a-button>
+      <a-button
+        size="large"
+        style="width: 150px;"
+        :disabled="spinning"
+        type="primary"
+        class="button-warning"
+        id="salesDetail-audit-btn"
+        v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
+        @click="handleAudit()"
+      >
+        审核
+      </a-button>
+    </div>
     <!-- 打印导出 -->
     <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
     <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('OUTING_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
+    <auditModal
+      :openModal="visibleAudit"
+      :content="auditText"
+      :spinning="spinningAudit"
+      @close="visibleAudit=false"
+      @ok="auditOrder('AUDIT_PASS')"
+      @fail="auditOrder('AUDIT_REJECT')" />
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -225,7 +250,8 @@ export default {
       visibleAudit: false,
       auditInfo: null,
       spinningAudit: false,
-      outStockStr: '' // 缺货产品信息说明
+      outStockStr: '', // 缺货产品信息说明
+      auditText: null
     }
   },
   computed: {
@@ -243,7 +269,7 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'left' },
         { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省级价', dataIndex: 'productEntity.provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -262,7 +288,7 @@ export default {
         arr.splice(ind, 0, { title: '市级价', dataIndex: 'productEntity.cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
-        arr.splice(arr.length - 3, 0, { title: '当前库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
+        arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
       }
       return arr
     }
@@ -289,6 +315,15 @@ export default {
         }
       })
     },
+    // 审核/批量审核
+    handleAudit (isBatch) {
+      if (isBatch) {
+        this.auditText = this.outStockStr + '是否审核通过?'
+      } else {
+        this.auditText = null
+      }
+      this.visibleAudit = true
+    },
     // 审核
     auditOrder (billStatus) {
       this.spinningAudit = true
@@ -300,7 +335,7 @@ export default {
           this.visibleAudit = false
           this.$message.success(res.message)
           this.spinningAudit = false
-          if (billStatus == 'OUTING_WAREHOUSE') {
+          if (billStatus == 'AUDIT_PASS') {
             this.handleDispatch({ salesBillSn: this.$route.params.sn })
           } else {
             //  关闭详情跳列表
@@ -422,9 +457,22 @@ export default {
 
 <style lang="less">
   .salesDetail-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
     .salesDetail-cont{
       margin-bottom: 10px;
     }
+    .flexBox{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+    }
     .footer-cont{
       margin-top: 5px;
       text-align: center;

+ 56 - 14
src/views/salesManagement/salesQuery/edit.vue

@@ -53,12 +53,27 @@
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
+          :pageSize="5"
           :scroll="{ y: 300 }"
           bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <a-badge count="缺" v-if="Number(record.stockQty) < Number(record.unpushedQty)">
+              <div style="padding-right: 15px;">{{ text }}</div>
+            </a-badge>
+            <span v-if="!(Number(record.stockQty) < Number(record.unpushedQty))">{{ text }}</span>
+          </template>
           <!-- 产品名称 -->
           <template slot="productName" slot-scope="text, record">
-            <span>{{ text }}</span>
-            <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
+            <div class="ellipsisCon">
+              <a-tooltip placement="rightBottom">
+                <template slot="title">
+                  <span>{{ text }}</span>
+                </template>
+                <span class="ellipsisText">{{ text }}</span>
+              </a-tooltip>
+              <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
+            </div>
           </template>
           <!-- 销售数量 -->
           <template slot="salesNums" slot-scope="text, record">
@@ -73,18 +88,26 @@
               @blur="e => onCellBlur(e.target.value, record)"
               style="width: 100%;" />
           </template>
+          <!-- 当前库存 -->
+          <template slot="stockQty" slot-scope="text, record">
+            <div v-if="record.stockQty || record.stockQty==0">
+              <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty) - Number(record.stockQty) }}</span>)</p>
+              <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
+            </div>
+            <span v-else>--</span>
+          </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <a-button
               size="small"
-              type="primary"
+              type="link"
               :loading="delLoading"
               class="button-error"
               @click="handleDel(record)"
             >删除</a-button>
             <a-button
               size="small"
-              type="primary"
+              type="link"
               :loading="delLoading"
               class="button-warning"
               @click="handleSelCx(record)"
@@ -141,7 +164,7 @@ import queryPart from './queryPart.vue'
 import queryPromotable from './queryPromotable.vue'
 import ChooseActive from './chooseActive.vue'
 import { salesDetailBySn, salesWriteSubmit, getPromoacActiveList } from '@/api/sales'
-import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, addPromoGoods } from '@/api/salesDetail'
+import { salesDetailStockList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, addPromoGoods } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   components: { STable, VSelect, queryPart, queryPromotable, ChooseActive },
@@ -163,20 +186,21 @@ export default {
       nowData: null,
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 120, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, align: 'center' },
-        { title: '售价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: 100, align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'totalAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center' }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '20%', align: 'center', sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '25%', align: 'left' },
+        { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
+        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.productForm.salesBillSn = this.$route.params.sn
-        return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
+        return salesDetailStockList(Object.assign(parameter, this.productForm)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -430,6 +454,24 @@ export default {
         color: #FF9900;
       }
     }
+    .redStyle{
+      font-weight: bold;
+      color: red;
+    }
+    .ellipsisCon{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      .ellipsisText{
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: box;
+        display: -webkit-box;
+        -webkit-line-clamp: 1;
+        -webkit-box-orient: vertical;
+      }
+    }
     .total-bar{
       display: flex;
       align-items: center;

+ 72 - 39
src/views/salesManagement/salesQuery/list.vue

@@ -105,21 +105,26 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
-          <div>
-            总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
-            总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
-            总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
-            已下推数量:<strong>{{ totalData&&(totalData.totalPushedQty || totalData.totalPushedQty==0) ? totalData.totalPushedQty : '--' }}</strong>;
-            已发货数量:<strong>{{ totalData&&(totalData.totalDispatchQty || totalData.totalDispatchQty==0) ? totalData.totalDispatchQty : '--' }}</strong>;
-            已取消数量:<strong>{{ totalData&&(totalData.totalCancelQty || totalData.totalCancelQty==0) ? totalData.totalCancelQty : '--' }}</strong>;
-            待下推数量:<strong>{{ totalData&&(totalData.totalUnpushedQty || totalData.totalUnpushedQty==0) ? totalData.totalUnpushedQty : '--' }}</strong>;
-          </div>
-          <div>
-            总售价:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;
-            已下推金额::<strong>{{ totalData&&(totalData.totalPushedAmount || totalData.totalPushedAmount==0) ? totalData.totalPushedAmount : '--' }}</strong>元;
-            已取消金额::<strong>{{ totalData&&(totalData.totalCancelAmount || totalData.totalCancelAmount==0) ? totalData.totalCancelAmount : '--' }}</strong>元;
-            待下推金额::<strong>{{ totalData&&(totalData.totalUnpushedAmount || totalData.totalUnpushedAmount==0) ? totalData.totalUnpushedAmount : '--' }}</strong>元;
-            已发货金额::<strong>{{ totalData&&(totalData.totalDispatchAmount || totalData.totalDispatchAmount==0) ? totalData.totalDispatchAmount : '--' }}</strong>元;
+          <div style="display: flex;justify-content: space-between;align-items: center;">
+            <div>
+              <div>
+                总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+                总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
+                总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+                已下推数量:<strong>{{ totalData&&(totalData.totalPushedQty || totalData.totalPushedQty==0) ? totalData.totalPushedQty : '--' }}</strong>;
+                已发货数量:<strong>{{ totalData&&(totalData.totalDispatchQty || totalData.totalDispatchQty==0) ? totalData.totalDispatchQty : '--' }}</strong>;
+                已取消数量:<strong>{{ totalData&&(totalData.totalCancelQty || totalData.totalCancelQty==0) ? totalData.totalCancelQty : '--' }}</strong>;
+                待下推数量:<strong>{{ totalData&&(totalData.totalUnpushedQty || totalData.totalUnpushedQty==0) ? totalData.totalUnpushedQty : '--' }}</strong>;
+              </div>
+              <div>
+                总售价:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;
+                已下推金额::<strong>{{ totalData&&(totalData.totalPushedAmount || totalData.totalPushedAmount==0) ? totalData.totalPushedAmount : '--' }}</strong>元;
+                已取消金额::<strong>{{ totalData&&(totalData.totalCancelAmount || totalData.totalCancelAmount==0) ? totalData.totalCancelAmount : '--' }}</strong>元;
+                待下推金额::<strong>{{ totalData&&(totalData.totalUnpushedAmount || totalData.totalUnpushedAmount==0) ? totalData.totalUnpushedAmount : '--' }}</strong>元;
+                已发货金额::<strong>{{ totalData&&(totalData.totalDispatchAmount || totalData.totalDispatchAmount==0) ? totalData.totalDispatchAmount : '--' }}</strong>元;
+              </div>
+            </div>
+            <a-checkbox v-model="showCancelNum"><span style="display: inline-block;margin-top: 1px;">显示取消数量</span></a-checkbox>
           </div>
         </div>
       </a-alert>
@@ -132,7 +137,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1620, y: tableHeight }"
+        :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
         <!-- 销售单号 -->
@@ -162,7 +167,7 @@
             size="small"
             type="link"
             class="button-warning"
-            v-if="record.billStatus == 'OUTING_WAREHOUSE'&&record.totalUnpushedQty>0&&$hasPermissions('B_salesDispatch')"
+            v-if="record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
             @click="handleDispatch(record)"
           >下推</a-button>
           <a-button
@@ -201,7 +206,7 @@
           >
             取消
           </a-button>
-          <span v-if="!(record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')) && !(record.billStatus == 'OUTING_WAREHOUSE'&&record.totalUnpushedQty>0&&$hasPermissions('B_salesDispatch')) && !(record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')) && !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')) && !(record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesDel')) && !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesDel'))">--</span>
+          <span v-if="!(record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')) && !(record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')) && !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')) && !(record.salesBillSource != 'PURCHASE' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesDel')) && !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT'||record.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesDel'))">--</span>
         </template>
       </s-table>
     </a-spin>
@@ -264,26 +269,26 @@ export default {
         totalDispatchAmount: 0
       },
       // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 120, align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: 60, align: 'center' },
-        { title: '总售价', dataIndex: 'totalAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '已下推数量', dataIndex: 'totalPushedQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已发货数量', dataIndex: 'totalDispatchQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数量', dataIndex: 'totalCancelQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'auditDate', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印次数', dataIndex: 'detailPrintTimes', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
-      ],
+      // columns: [
+      //   { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+      //   { title: '创建时间', dataIndex: 'createDate', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 120, align: 'center' },
+      //   { title: '采购单号', dataIndex: 'purchaseBillNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+      //   { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: 60, align: 'center' },
+      //   { title: '总售价', dataIndex: 'totalAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      //   { title: '已下推数量', dataIndex: 'totalPushedQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      //   { title: '已发货数量', dataIndex: 'totalDispatchQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      //   { title: '已取消数量', dataIndex: 'totalCancelQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      //   { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      //   { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '审核时间', dataIndex: 'auditDate', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '业务状态', dataIndex: 'billStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+      //   { title: '打印次数', dataIndex: 'detailPrintTimes', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      //   { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      // ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -305,7 +310,35 @@ export default {
           return data
         })
       },
-      addrProvinceList: [] //  省下拉
+      addrProvinceList: [], //  省下拉
+      showCancelNum: false //  是否显示取消数量和待下推数量
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '10%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '9%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: '4%', align: 'center' },
+        { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已下推数量', dataIndex: 'totalPushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已发货数量', dataIndex: 'totalDispatchQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'detailPrintTimes', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      if (this.showCancelNum) {
+        arr.splice(9, 0, { title: '已取消数量', dataIndex: 'totalCancelQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 18 - 1
src/views/salesManagement/salesQuery/printModal.vue

@@ -27,6 +27,13 @@
             </a-select-option>
           </a-select>
         </a-form-model-item>
+        <a-form-model-item label="是否缺货产品" prop="dataScope" v-if="nowType=='export'">
+          <a-radio-group v-model="form.dataScope">
+            <a-radio value="all">全部</a-radio>
+            <a-radio value="enough">有库存</a-radio>
+            <a-radio value="less">缺货</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
         <a-form-model-item label="产品售价" prop="priceType">
           <a-radio-group v-model="form.priceType">
             <a-radio :value="nowType=='SALES_BILL_TYPE' ? 'SALES_BILL_TYPE_COST' : 'SALES_BILL_COST'">{{ nowType=='export' ? '导出' : '打印' }}</a-radio>
@@ -66,10 +73,12 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: {
         id: 'all',
+        dataScope: 'all',
         priceType: undefined
       },
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
+        dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择产品售价', trigger: 'change' }]
       },
       formItemLayout: {
@@ -111,10 +120,18 @@ export default {
               }
               _this.$emit('ok', obj)
             }
-          } else {
+          } else if (_this.nowType == 'SALES_BILL') {
+            const obj = {
+              salesBillSn: _this.itemData.salesBillSn,
+              priceType: _this.form.priceType,
+              type: isPrint || 'preview'
+            }
+            _this.$emit('ok', obj)
+          } else if (_this.nowType == 'export') {
             const obj = {
               salesBillSn: _this.itemData.salesBillSn,
               priceType: _this.form.priceType,
+              dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
               type: isPrint || 'preview'
             }
             _this.$emit('ok', obj)

+ 42 - 16
src/views/salesManagement/salesQuery/queryPart.vue

@@ -26,7 +26,7 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品类">
+              <a-form-item label="产品类">
                 <ProductType id="productInfoList-productType" v-model="productType" @change="changeProductType"></ProductType>
               </a-form-item>
             </a-col>
@@ -55,7 +55,8 @@
       :columns="columns"
       :data="loadData"
       :customRow="handleClickRow"
-      :scroll="{ x: 930, y: 300 }"
+      :pageSize="10"
+      :scroll="{ y: 149 }"
       :defaultLoadData="false"
       bordered>
       <!-- 销售数量 -->
@@ -67,19 +68,27 @@
             :precision="0"
             :min="1"
             :max="999999"
+            style="width: 100%;"
             placeholder="请输入" />
         </div>
       </template>
       <!-- 产品名称 -->
       <template slot="productName" slot-scope="text, record">
-        <span style="vertical-align: middle;">{{ text }}</span>
-        <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.isJoinActivityProduct == 1"></a-badge>
+        <div class="ellipsisCon">
+          <a-tooltip placement="rightBottom">
+            <template slot="title">
+              <span>{{ text }}</span>
+            </template>
+            <span class="ellipsisText">{{ text }}</span>
+          </a-tooltip>
+          <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.isJoinActivityProduct == 1"></a-badge>
+        </div>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
           size="small"
-          type="primary"
+          type="link"
           class="button-info"
           :loading="newLoading"
           @click="handleAdd(record)"
@@ -118,17 +127,16 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        // { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, align: 'center' },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'currentStockQty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '包装数', dataIndex: 'packQtyV', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 100, align: 'center' },
-        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, width: '18%', align: 'left' },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productBrandName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '包装数', dataIndex: 'packQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -203,3 +211,21 @@ export default {
   }
 }
 </script>
+<style lang="less" scoped>
+  .productInfoList-wrap{
+    .ellipsisCon{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      .ellipsisText{
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: box;
+        display: -webkit-box;
+        -webkit-line-clamp: 1;
+        -webkit-box-orient: vertical;
+      }
+    }
+  }
+</style>

+ 13 - 16
src/views/salesManagement/salesQuery/queryPromotable.vue

@@ -7,13 +7,10 @@
     :rowKey="(record) => record.id"
     :columns="columns"
     :data="loadData"
-    :scroll="{ x:1010, y: 300 }"
+    :pageSize="5"
+    :scroll="{ y: 300 }"
     :defaultLoadData="false"
     bordered>
-    <!-- 产品名称 -->
-    <template slot="productName" slot-scope="text, record">
-      <span>{{ text }}</span>
-    </template>
     <!-- 销售数量 -->
     <template slot="salesNums" slot-scope="text, record">
       <a-input-number
@@ -31,7 +28,7 @@
     <template slot="action" slot-scope="text, record">
       <a-button
         size="small"
-        type="primary"
+        type="link"
         :loading="delLoading"
         class="button-error"
         @click="handleDel(record)"
@@ -74,18 +71,18 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 120, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, align: 'center' },
-        { title: '原售价', dataIndex: 'origPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'qty', scopedSlots: { customRender: 'salesNums' }, width: 100, align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销类型', dataIndex: 'promotionRulesName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原售价', dataIndex: 'origPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'qty', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销类型', dataIndex: 'promotionRulesName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) {
-        arr.splice(3, 0, { title: '成本价', dataIndex: 'showCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(3, 0, { title: '成本价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }

+ 11 - 78
src/views/salesManagement/salesReturn/detail.vue

@@ -61,7 +61,6 @@
           :rowKey="record => record.id"
           :columns="columns"
           :data="loadData"
-          :scroll="{ x: 1430 }"
           :defaultLoadData="false"
           bordered></s-table>
       </a-card>
@@ -118,83 +117,17 @@ export default {
       disabled: false,
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: 200, customRender: function (text) { return text || '--' } },
-        {
-          title: '产品编码',
-          dataIndex: 'productEntity.code',
-          align: 'center',
-          width: 160,
-          customRender: function (text) { return text || '--' }
-        },
-        {
-          title: '产品名称',
-          dataIndex: 'productEntity.name',
-          align: 'center',
-          width: 200,
-          customRender: function (text) { return text || '--' },
-          ellipsis: true
-        },
-        {
-          title: '售价',
-          dataIndex: 'price',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return ((text || text == 0) ? '¥' + text : '--')
-          }
-        },
-        {
-          title: '退货数量',
-          dataIndex: 'qty',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || text == 0 ? text : '--'
-          }
-        },
-        {
-          title: '坏件数量',
-          dataIndex: 'badQty',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || text == 0 ? text : '--'
-          }
-        },
-        {
-          title: '返库数量',
-          dataIndex: 'backStockQty',
-          width: 100,
-          align: 'center',
-          customRender: function (text) {
-            return text || text == 0 ? text : '--'
-          }
-        },
-        {
-          title: '单位',
-          dataIndex: 'productEntity.unit',
-          align: 'center',
-          width: 100,
-          customRender: function (text) { return text || '--' }
-        },
-        {
-          title: '退货金额小计',
-          dataIndex: 'saleReturnSubtotal',
-          width: 120,
-          align: 'center',
-          customRender: function (text) {
-            return ((text || text == 0) ? '¥' + text : '--')
-          }
-        },
-        {
-          title: '退货原因',
-          dataIndex: 'remark',
-          width: 150,
-          align: 'center',
-          customRender: function (text) { return text || '--' },
-          ellipsis: true
-        }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '17%', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', width: '17%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '售价', dataIndex: 'price', 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: 'badQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return text || text == 0 ? text : '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
+        { title: '退货金额小计', dataIndex: 'saleReturnSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'remark', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 20 - 19
src/views/salesManagement/salesReturn/queryPart.vue

@@ -37,7 +37,7 @@
       :customRow="handleClickRow"
       :rowClassName="(record, index) => (grabFlag == '1'&&record.refundableQty==0) ? 'redBg-row':''"
       :defaultLoadData="false"
-      :scroll="{ x: grabFlag == '1' ? 930 : 710, y: 300 }"
+      :scroll="{ y: 300 }"
       bordered>
       <!-- 本次退货数量 -->
       <template slot="qty" slot-scope="text, record">
@@ -48,6 +48,7 @@
             :precision="0"
             :min="0"
             :max="999999"
+            style="width: 100%;"
             placeholder="请输入" />
         </div>
       </template>
@@ -153,26 +154,26 @@ export default {
       // 抓单
       if (this.grabFlag == 1) {
         this.columns = [
-          { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-          { title: '销售单号', dataIndex: 'salesBillNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '售价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '剩余可退数量', dataIndex: 'refundableQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '本次退货数量', dataIndex: 'qty', width: 100, align: 'center', scopedSlots: { customRender: 'qty' } },
-          { title: '采购价', dataIndex: 'showCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }]
+          { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+          { title: '销售单号', dataIndex: 'salesBillNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '产品编码', dataIndex: 'productEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+          { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '剩余可退数量', dataIndex: 'refundableQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '本次退货数量', dataIndex: 'qty', width: '8%', align: 'center', scopedSlots: { customRender: 'qty' } },
+          { title: '采购价', dataIndex: 'showCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }]
       } else {
         this.columns = [
-          { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-          { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '当前售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '退货数量', dataIndex: 'qty', width: 100, align: 'center', scopedSlots: { customRender: 'qty' } },
-          { title: '采购价', dataIndex: 'lastStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: 80, align: 'center' }
+          { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+          { title: '产品编码', dataIndex: 'productCode', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '产品名称', dataIndex: 'productName', width: '27%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+          { title: '当前售价', dataIndex: 'productPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '退货数量', dataIndex: 'qty', width: '9%', align: 'center', scopedSlots: { customRender: 'qty' } },
+          { title: '采购价', dataIndex: 'lastStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+          { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
         ]
       }
       this.resetSearchForm()

+ 9 - 9
src/views/salesManagement/salesReturn/salesReturnCheck.vue

@@ -22,7 +22,7 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
-          :scroll="{ x: 710, y: tableHeight }"
+          :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
           bordered>
           <!-- 返库数量 -->
@@ -89,14 +89,14 @@ export default {
       },
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: 120, customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货数量', dataIndex: 'qty', align: 'center', width: 80, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: 80, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: 100, align: 'center', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', customRender: function (text) { return text || '--' }, width: 60 },
-        { title: '售价', dataIndex: 'price', align: 'center', width: 80, customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '23%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货数量', dataIndex: 'qty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       chooseLoadData: [],
       // 加载数据方法 必须为 Promise 对象

+ 10 - 10
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -36,7 +36,7 @@
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :scroll="{ x: 910, y: 300 }"
+          :scroll="{ y: 300 }"
           bordered>
           <!-- 本次退货数量 -->
           <template slot="qty" slot-scope="text, record">
@@ -135,15 +135,15 @@ export default {
       },
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', align: 'center', width: 70 },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货数量', dataIndex: 'qty', align: 'center', width: 100, scopedSlots: { customRender: 'qty' } },
-        { title: '退货单价', dataIndex: 'price', align: 'center', width: 80, scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: 60, customRender: function (text) { return text || '--' } },
-        { title: '退货小计', align: 'center', dataIndex: 'totalAmount', width: 80, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', align: 'center', width: 200, scopedSlots: { customRender: 'remark' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货数量', dataIndex: 'qty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
+        { title: '退货单价', dataIndex: 'price', align: 'center', width: '8%', scopedSlots: { customRender: 'price' } },
+        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '退货小计', align: 'center', dataIndex: 'totalAmount', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'remark', align: 'center', width: '13%', scopedSlots: { customRender: 'remark' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       chooseLoadData: [],
       // 加载数据方法 必须为 Promise 对象

+ 19 - 13
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -36,7 +36,7 @@
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :scroll="{ x: 1270, y: 300 }"
+          :scroll="{ y: 300 }"
           bordered>
           <!-- 本次退货数量 -->
           <template slot="qty" slot-scope="text, record">
@@ -66,7 +66,13 @@
           </template>
           <!-- 退货原因 -->
           <template slot="remark" slot-scope="text, record">
-            <a-input size="small" placeholder="30个字符内" :maxLength="30" v-model="record.remark" @blur="updateRemark(record)"></a-input>
+            <a-input
+              size="small"
+              placeholder="30个字符内"
+              :maxLength="30"
+              v-model="record.remark"
+              @blur="updateRemark(record)"
+              style="width: 100%;"></a-input>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
@@ -123,17 +129,17 @@ export default {
       },
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', align: 'center', width: 70 },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: 180, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '剩余可退数量', dataIndex: 'refundableQty', align: 'center', width: 100, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次退货数量', dataIndex: 'qty', align: 'center', width: 100, scopedSlots: { customRender: 'qty' } },
-        { title: '退货单价', dataIndex: 'price', align: 'center', width: 100, scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: 60, customRender: function (text) { return text || '--' } },
-        { title: '退货小计', align: 'center', width: 80, dataIndex: 'totalAmount', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remark', align: 'center', width: 200, scopedSlots: { customRender: 'remark' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '14%', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '剩余可退数量', dataIndex: 'refundableQty', align: 'center', width: '9%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次退货数量', dataIndex: 'qty', align: 'center', width: '9%', scopedSlots: { customRender: 'qty' } },
+        { title: '退货单价', dataIndex: 'price', align: 'center', width: '8%', scopedSlots: { customRender: 'price' } },
+        { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '退货小计', align: 'center', width: '8%', dataIndex: 'totalAmount', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'remark', align: 'center', width: '10%', scopedSlots: { customRender: 'remark' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       chooseLoadData: [],
       // 加载数据方法 必须为 Promise 对象

+ 3 - 2
src/views/salesManagement/waitDispatch/edit.vue

@@ -107,7 +107,8 @@ import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import { salesDetailBySn } from '@/api/sales'
 import { salesDetailDispatchByOneKey, insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetail'
-import { deleteBatch, pushDown, dispatchDetail, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
+import { deleteBatch, pushDown, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
+import { findBySalesBillSn } from '@/api/dispatch'
 export default {
   name: 'SalesDetail',
   components: { STable, VSelect, queryPart },
@@ -189,7 +190,7 @@ export default {
     },
     // 统计查询
     getTotalData () {
-      dispatchDetail({ dispatchBillSn: this.$route.params.dispatchBillSn }).then(res => {
+      findBySalesBillSn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
         if (res.status == 200) {
           this.totalData = res.data || null
         } else {

+ 4 - 4
src/views/salesManagement/waitDispatch/queryPart.vue

@@ -27,7 +27,7 @@
           </a-col>
           <a-col :md="4" :sm="24">
             <a-form-item label="类型">
-              <a-select allowClear v-model.trim="queryParam.ptype" >
+              <a-select allowClear v-model.trim="queryParam.ptype" :dropdownMatchSelectWidth="false" >
                 <a-select-option value="0">
                   全部产品
                 </a-select-option>
@@ -205,9 +205,9 @@ export default {
   computed: {
     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', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '14%', align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },