chenrui преди 3 години
родител
ревизия
31a68bbe48

+ 12 - 1
src/api/salesDetail.js

@@ -48,7 +48,7 @@ export const salesDetailList = (params) => {
   })
 }
 
-// 销售详情列表不分页
+// 销售详情列表不分页  不带库存
 export const salesDetailAllList = (params) => {
   const url = `/sales/detail/query`
   delete params.pageNo
@@ -60,6 +60,17 @@ export const salesDetailAllList = (params) => {
   })
 }
 
+// 销售详情列表不分页  带库存
+export const salesDetailAllStockList = (params) => {
+  const url = `/sales/detail/queryStock`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 // 修改销售明细取消数量
 export const salesDetailUpdateCancelQty = (params) => {
   return axios({

+ 231 - 152
src/views/salesManagement/salesQuery/detail.vue

@@ -1,135 +1,159 @@
 <template>
   <div class="salesDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
-      <template slot="subTitle">
-        <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
-      </template>
-      <template slot="extra">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+        </template>
+        <template slot="extra">
+          <a-button
+            key="4"
+            type="primary"
+            class="button-error"
+            id="salesDetail-xs-print-btn"
+            v-if="$hasPermissions('B_salesPrint')"
+            :disabled="localDataSource.length==0"
+            @click="handlePrint('SALES_BILL')">销售打印</a-button>
+          <a-button
+            key="3"
+            type="primary"
+            class="button-info"
+            id="salesDetail-xsfl-print-btn"
+            v-if="$hasPermissions('B_salesPrint')"
+            :disabled="localDataSource.length==0"
+            @click="handlePrint('SALES_BILL_TYPE')">销售分类打印</a-button>
+          <a-button
+            key="2"
+            type="primary"
+            class="button-warning"
+            id="salesDetail-export-btn"
+            v-if="$hasPermissions('B_salesExport')"
+            :disabled="localDataSource.length==0"
+            @click="handlePrint('export')">导出Excel</a-button>
+          <a-button
+            key="1"
+            type="primary"
+            class="button-success"
+            id="salesDetail-export-btn"
+            v-if="$hasPermissions('B_salesExport')"
+            :disabled="localDataSource.length==0"
+            @click="handlePrint('typeExport')">分类导出</a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="salesDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货地址" :span="2">{{ shippingAddress }}</a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货人">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货电话">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注" :span="3">
+                <!-- 可审核时需显示具体缺货产品的信息 -->
+                <p v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')">
+                  <span v-if="outStockStr || detailData&&detailData.remarks">{{ outStockStr }}{{ detailData&&detailData.remarks }}</span>
+                  <span v-else>--</span>
+                </p>
+                <p v-else>{{ detailData&&detailData.remarks || '--' }}</p>
+              </a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- alert -->
+        <a-alert type="info" style="margin-bottom: 10px;">
+          <div slot="message">
+            <div style="display: flex;justify-content: space-between;align-items: center;">
+              <div>
+                总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
+                已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
+                已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
+                待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
+                已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
+                待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
+                总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
+                <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;</span>
+                总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
+                已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;
+                已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount : '--' }}</strong>;
+                待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? detailData.totalUnpushedAmount : '--' }}</strong>;
+                已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? detailData.totalDispatchAmount : '--' }}</strong>;
+                待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;
+              </div>
+              <a-checkbox v-model="isCityPrice"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+            </div>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          :showPagination="false"
+          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>
+            <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
+          </template>
+        </s-table>
+      </a-card>
+      <a-card size="small" :bordered="false" class="footer-cont">
         <a-button
-          key="4"
           type="primary"
-          class="button-error"
-          id="salesDetail-xs-print-btn"
-          v-if="$hasPermissions('B_salesPrint')"
-          :disabled="localDataSource.length==0"
-          @click="handlePrint('SALES_BILL')">销售打印</a-button>
+          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
-          key="3"
+          size="large"
+          style="width: 150px;"
           type="primary"
           class="button-info"
-          id="salesDetail-xsfl-print-btn"
-          v-if="$hasPermissions('B_salesPrint')"
-          :disabled="localDataSource.length==0"
-          @click="handlePrint('SALES_BILL_TYPE')">销售分类打印</a-button>
+          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
-          key="2"
+          size="large"
+          style="width: 150px;"
           type="primary"
           class="button-warning"
-          id="salesDetail-export-btn"
-          v-if="$hasPermissions('B_salesExport')"
-          :disabled="localDataSource.length==0"
-          @click="handlePrint('export')">导出Excel</a-button>
-        <a-button
-          key="1"
-          type="primary"
-          class="button-success"
-          id="salesDetail-export-btn"
-          v-if="$hasPermissions('B_salesExport')"
-          :disabled="localDataSource.length==0"
-          @click="handlePrint('typeExport')">分类导出</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="salesDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions size="small" :column="3">
-            <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货地址">
-              {{ shippingAddress }}
-            </a-descriptions-item>
-            <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货人">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="收货电话">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="pages-wrap">
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom: 10px;">
-        <div slot="message">
-          <div style="display: flex;justify-content: space-between;align-items: center;">
-            <div>
-              总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-              已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
-              已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
-              待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
-              已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
-              待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
-              总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
-              <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;</span>
-              总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
-              已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;
-              已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount : '--' }}</strong>;
-              待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? detailData.totalUnpushedAmount : '--' }}</strong>;
-              已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? detailData.totalDispatchAmount : '--' }}</strong>;
-              待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;
-            </div>
-            <a-checkbox v-model="isCityPrice"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
-          </div>
-        </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1290 }"
-        :defaultLoadData="false"
-        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>
-          <span v-else>{{ text }}</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-card>
+          id="salesDetail-audit-btn"
+          v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
+          @click="visibleAudit=true"
+        >
+          审核
+        </a-button>
+      </a-card>
+    </a-spin>
     <!-- 打印导出 -->
     <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')" />
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -139,32 +163,51 @@
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
-import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel } from '@/api/sales'
-import { salesDetailList } from '@/api/salesDetail'
+import auditModal from '@/views/common/auditModal.vue'
+import { findBySalesBillSn } from '@/api/dispatch'
+import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit } from '@/api/sales'
+import { salesDetailAllList, salesDetailAllStockList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
-  components: { STable, VSelect, printModal },
+  components: { STable, VSelect, printModal, auditModal },
   data () {
     return {
+      spinning: false,
       disabled: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return salesDetailList(Object.assign(parameter, { salesBillSn: this.$route.params.sn })).then(res => {
+        const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn })
+        let url = salesDetailAllList
+        if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
+          url = salesDetailAllStockList
+        } else { // 非审核
+          url = salesDetailAllList
+        }
+        return url(params).then(res => {
           const data = res.data
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
-            const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
-            const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
-            const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
-            data.list[i].productCode = productCode || '--'
-            data.list[i].productName = productName || '--'
-            data.list[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-            data.list[i].productOrigUnit = productOrigUnit || '--'
+          const no = 0
+          this.outStockStr = ''
+          let str = ''
+          for (var i = 0; i < data.length; i++) {
+            data[i].no = no + i + 1
+            const productCode = (data[i].productEntity && data[i].productEntity.code) || (data[i].dealerProductEntity && data[i].dealerProductEntity.code)
+            const productName = (data[i].productEntity && data[i].productEntity.name) || (data[i].dealerProductEntity && data[i].dealerProductEntity.name)
+            const productOrigCode = (data[i].productEntity && data[i].productEntity.origCode) || (data[i].dealerProductEntity && data[i].dealerProductEntity.origCode)
+            const productOrigUnit = (data[i].productEntity && data[i].productEntity.unit) || (data[i].dealerProductEntity && data[i].dealerProductEntity.unit)
+            data[i].productCode = productCode || '--'
+            data[i].productName = productName || '--'
+            data[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+            data[i].productOrigUnit = productOrigUnit || '--'
+            if (data[i].unpushedQty && (Number(data[i].stockQty) < Number(data[i].unpushedQty))) {
+              str += data[i].productCode + '、'
+            }
+          }
+          if (str.length > 0) {
+            str = str.substr(0, str.length - 1)
+            this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
           }
-          this.localDataSource = data.list
+          this.localDataSource = data
           this.disabled = false
           return data
         })
@@ -173,7 +216,11 @@ export default {
       openModal: false,
       detailData: null, //  详情数据
       nowType: null,
-      isCityPrice: false //  是否显示市级价
+      isCityPrice: false, //  是否显示市级价
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false,
+      outStockStr: '' // 缺货产品信息说明
     }
   },
   computed: {
@@ -190,24 +237,24 @@ export default {
     },
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: 50, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 180, scopedSlots: { customRender: 'productCode' }, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省级价', dataIndex: 'productEntity.provincePrice', 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: 'productOrigUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数', dataIndex: 'cancelQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已下推数', dataIndex: 'pushedQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '待下推数', dataIndex: 'unpushedQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省级价', dataIndex: 'productEntity.provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_isShowCost')) {
-        arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       if (this.isCityPrice) {
         const ind = this.$hasPermissions('B_isShowCost') ? 6 : 5
-        arr.splice(ind, 0, { title: '市级价', dataIndex: 'productEntity.cityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind, 0, { title: '市级价', dataIndex: 'productEntity.cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }
@@ -228,11 +275,45 @@ export default {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data || null
+          this.$refs.table.refresh(true)
         } else {
           this.detailData = null
         }
       })
     },
+    // 审核
+    auditOrder (billStatus) {
+      this.spinningAudit = true
+      salesWriteAudit({
+        salesBillSn: this.$route.params.sn,
+        billStatus: billStatus
+      }).then(res => {
+        if (res.status == 200) {
+          this.visibleAudit = false
+          this.$message.success(res.message)
+          this.spinningAudit = false
+          if (billStatus == 'OUTING_WAREHOUSE') {
+            this.handleDispatch({ salesBillSn: this.$route.params.sn })
+          } else {
+            //  关闭详情跳列表
+            this.handleBack()
+          }
+        } else {
+          this.visibleAudit = false
+          this.spinningAudit = false
+        }
+      })
+    },
+    // 下推
+    handleDispatch (row) {
+      this.spinning = true
+      findBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => {
+        this.spinning = false
+        if (res.status == 200) {
+          this.$router.push({ name: 'waitDispatch', params: { salesBillSn: row.salesBillSn, dispatchBillSn: res.data.dispatchBillSn } })
+        }
+      })
+    },
     // 打印导出
     handlePrint (type) {
       if (type == 'typeExport') {
@@ -316,14 +397,12 @@ export default {
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.$refs.table.refresh(true)
       this.getDetail()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.$refs.table.refresh(true)
       this.getDetail()
     }
   },

+ 4 - 35
src/views/salesManagement/salesQuery/list.vue

@@ -156,7 +156,7 @@
             type="link"
             class="button-warning"
             v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
-            @click="handleEexamine(record)"
+            @click="handleDetail(record)"
           >审核</a-button>
           <a-button
             size="small"
@@ -207,8 +207,6 @@
     </a-spin>
     <!-- 选择客户弹框 -->
     <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
-    <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('OUTING_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
   </a-card>
 </template>
 
@@ -219,14 +217,13 @@ import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
-import auditModal from '@/views/common/auditModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
-import { salesList, salesDel, salesWriteAudit, salesCount } from '@/api/sales'
+import { salesList, salesDel, salesCount } from '@/api/sales'
 import { findBySalesBillSn } from '@/api/dispatch'
 export default {
   name: 'TableList',
-  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, auditModal, subarea },
+  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea },
   data () {
     return {
       spinning: false,
@@ -308,10 +305,7 @@ export default {
           return data
         })
       },
-      addrProvinceList: [], //  省下拉
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false
+      addrProvinceList: [] //  省下拉
     }
   },
   methods: {
@@ -341,31 +335,6 @@ export default {
         }
       })
     },
-    //  审核
-    handleEexamine (row) {
-      this.auditInfo = row
-      this.visibleAudit = true
-    },
-    auditOrder (billStatus) {
-      this.spinningAudit = true
-      salesWriteAudit({
-        salesBillSn: this.auditInfo.salesBillSn,
-        billStatus: billStatus
-      }).then(res => {
-        if (res.status == 200) {
-          this.visibleAudit = false
-          this.$message.success(res.message)
-          this.$refs.table.refresh()
-          this.spinningAudit = false
-          if (billStatus == 'OUTING_WAREHOUSE') {
-            this.handleDispatch({ salesBillSn: this.auditInfo.salesBillSn })
-          }
-        } else {
-          this.visibleAudit = false
-          this.spinningAudit = false
-        }
-      })
-    },
     // 详情
     handleDetail (row) {
       this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })

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

@@ -131,7 +131,7 @@
 </template>
 
 <script>
-import { salesDetailAllList } from '@/api/salesDetail'
+import { salesDetailAllStockList } from '@/api/salesDetail'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
@@ -170,7 +170,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.queryParam.salesBillSn = this.salesBillSn
-        return salesDetailAllList(Object.assign(parameter, this.queryParam)).then(res => {
+        return salesDetailAllStockList(Object.assign(parameter, this.queryParam)).then(res => {
           let data = res.data
           if (data) {
             // 根据类型过滤数据