浏览代码

销售打印

lilei 3 年之前
父节点
当前提交
c9fea29fc5

+ 2 - 2
src/views/allocationManagement/transfersPrint/list.vue

@@ -52,7 +52,7 @@
                     <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                   </a-form-item>
                 </a-col>
-                <!-- <a-col :md="4" :sm="24">
+                <a-col :md="4" :sm="24" v-if="currentTab == 1">
                   <a-form-item label="打印状态">
                     <v-select
                       v-model="queryParam.printState"
@@ -63,7 +63,7 @@
                       allowClear
                     ></v-select>
                   </a-form-item>
-                </a-col> -->
+                </a-col>
               </template>
               <a-col :md="6" :sm="24">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>

+ 1 - 1
src/views/allocationManagement/transfersPrint/recordModal.vue

@@ -49,7 +49,7 @@
 import { STable, VSelect } from '@/components'
 import { printLogQueryPage } from '@/api/data'
 export default {
-  name: 'CommonModal',
+  name: 'RecordModal',
   components: { STable, VSelect },
   props: {
     openModal: { //  弹框显示状态

+ 133 - 84
src/views/salesManagement/receiptPrint/list.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="receiptPrint-wrap">
     <div style="background-color: #fff;">
-      <a-tabs default-active-key="2">
-        <a-tab-pane key="1" tab="全部">
+      <a-tabs v-model="currentTab" @change="changeTab">
+        <a-tab-pane :key="1" tab="全部">
         </a-tab-pane>
-        <a-tab-pane key="2" tab="待打印">
+        <a-tab-pane :key="2" tab="待打印">
         </a-tab-pane>
       </a-tabs>
     </div>
@@ -20,19 +20,24 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                  <dealerSubareaScopeList ref="dealerSubareaScopeList" id="receiptPrint-buyerName" @change="custChange" />
+                <a-form-item label="客户名称">
+                  <a-input id="salesCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入客户名称"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="销售单号">
-                  <a-input id="receiptPrint-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                  <a-input id="salesCollectionList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入销售单号"/>
                 </a-form-item>
               </a-col>
               <template v-if="advanced">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="备货单号">
-                    <a-input id="receiptPrint-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                    <a-input id="salesCollectionList-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="收货客户名称">
+                    <a-input id="salesCollectionList-receiverName" v-model.trim="queryParam.receiverName" allowClear placeholder="请输入收货客户名称"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -40,23 +45,50 @@
                     <v-select
                       v-model="queryParam.billStatus"
                       ref="billStatus"
-                      id="receiptPrint-billStatus"
+                      id="salesCollectionList-billStatus"
                       code="DISPATCH_BILL_STATUS"
                       placeholder="请选择业务状态"
                       allowClear></v-select>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
-                  <a-form-model-item label="所在区域">
-                    <subarea id="receiptPrint-subarea" v-model="queryParam.subareaSn"></subarea>
-                  </a-form-model-item>
+                  <a-form-item label="单据状态">
+                    <v-select
+                      v-model="queryParam.voidFlag"
+                      ref="voidFlag"
+                      id="salesCollectionList-voidFlag"
+                      code="VOID_FLAG"
+                      placeholder="请选择单据状态"
+                      allowClear></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24" v-if="currentTab == 1">
+                  <a-form-item label="收款打印状态">
+                    <v-select
+                      v-model="queryParam.printState"
+                      ref="printState"
+                      id="salesCollectionList-printState"
+                      code="PRINT_STATUS"
+                      placeholder="请选择打印状态"
+                      allowClear
+                    ></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="所在区域">
+                    <subarea id="salesCollectionList-subarea" v-model="queryParam.subareaSn"></subarea>
+                  </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
-                  <a-form-model-item label="地区">
-                    <a-form-model-item prop="shippingAddrProvinceSn">
-                      <Area id="receiptPrint-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                    </a-form-model-item>
-                  </a-form-model-item>
+                  <a-row>
+                    <a-form-item label="地区">
+                      <a-col span="24">
+                        <a-form-item prop="dealerProvinceSn" style="margin: 0;">
+                          <Area id="salesCollectionList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
+                        </a-form-item>
+                      </a-col>
+                    </a-form-item>
+                  </a-row>
                 </a-col>
               </template>
               <a-col :md="6" :sm="24">
@@ -76,7 +108,7 @@
         <s-table
           class="sTable fixPagination"
           ref="table"
-          :style="{ height: tableHeight+84.5+'px' }"
+          :style="{ height: tableHeight+60.5+'px' }"
           size="small"
           :rowKey="(record) => record.id"
           :columns="columns"
@@ -84,36 +116,39 @@
           :scroll="{ y:tableHeight }"
           :defaultLoadData="false"
           bordered>
-          <!-- 销售单号 -->
-          <template slot="salesBillNo" slot-scope="text, record">
-            <span class="link-bule" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
-            <span v-else>{{ record.salesBillNo }}</span>
+          <!-- 单号 -->
+          <template slot="bizNo" slot-scope="text, record">
+            <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.bizNo }}</span>
+            <span v-else>{{ record.bizNo }}</span>
           </template>
-          <!-- 备货单号 -->
+          <!-- 下推单号 -->
           <template slot="dispatchBillNo" slot-scope="text, record">
-            <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
-            <span v-else>{{ record.dispatchBillNo }}</span>
+            <span v-if="$hasPermissions('B_dispatchDetail')" class="link-bule" @click="handleBhDetail(record)">{{ record.dispatchBillNo }}</span>
+            <span v-else>{{ record.dispatchBillNo || '--' }}</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <a-button
               size="small"
               type="link"
+              v-if="record.printState == 'NO_PRINT'"
               class="button-warning"
-              @click="viewPrint(record)"
-            >打印记录</a-button>
+              @click="handlePrint(record)"
+            >收款打印</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
-              @click="handlePrint(record)"
-            >收款打印</a-button>
+              v-else-if="record.printState == 'PRINT'"
+              @click="viewPrint(record)"
+            >打印记录</a-button>
+            <span v-else>--</span>
           </template>
         </s-table>
 
         <!-- 操作提示 -->
-        <commonModal modalTit="收款打印" :openModal="showTipModal" @cancel="showTipModal=false">
-          <div style="line-height: 30px;">
+        <<!-- commonModal modalTit="收款打印" :openModal="showTipModal" @cancel="showTipModal=false">
+          <div style="line-height: 30px;" v-if="tipData">
             <div>销售单号:{{ tipData&&tipData.buyerName }}</div>
             <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
             <div>发货编号:{{ tipData&&tipData.buyerName }}</div>
@@ -121,10 +156,10 @@
             <div>收货客户名称:{{ tipData&&tipData.buyerName }}</div>
             <div>产品分类:{{ tipData&&tipData.buyerName }}</div>
           </div>
-        </commonModal>
+        </commonModal> -->
 
-        <!-- 打印记录 -->
-        <recordModal modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
+        !-- 打印记录 -->
+        <recordModal ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
       </a-spin>
     </a-card>
   </div>
@@ -133,7 +168,6 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
-import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
@@ -141,7 +175,7 @@ import Area from '@/views/common/area.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import recordModal from './recordModal.vue'
-import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
+import { settleReceiptList } from '@/api/settleReceipt'
 export default {
   name: 'PushOrderManagementList',
   mixins: [commonMixin],
@@ -152,20 +186,21 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
-      time: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ],
+      time: [],
+      currentTab: 2,
       // 查询参数
       queryParam: {
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        buyerSn: undefined, //  客户名称
-        salesBillNo: '', //  销售单号
-        dispatchBillNo: '', //  备货单号
-        billStatus: undefined, //  业务状态
+        beginDate: '',
+        endDate: '',
+        bizNo: '',
+        dispatchBillNo: '',
+        settleClientName: '',
+        receiverName: '',
         subareaSn: undefined,
-        shippingAddrProvinceSn: undefined
+        billStatus: undefined,
+        voidFlag: undefined,
+        dealerProvinceSn: undefined,
+        printState: 'NO_PRINT'
       },
       totalData: {
         totalAmount: 0,
@@ -175,16 +210,11 @@ export default {
       showTipModal: false,
       tipData: null,
       showRecordModal: false,
-      recordData: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        // 查询总计
-        dispatchQueryCount(Object.assign(parameter, this.queryParam)).then(res => {
-          this.totalData = Object.assign(this.totalData, res.data || {})
-        })
-        return dispatchlList(Object.assign(parameter, this.queryParam)).then(res => {
+        return settleReceiptList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -204,24 +234,33 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '14%', align: 'center' },
-        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '14%', align: 'center' },
-        { title: '发货编号', dataIndex: 'buyerName1', width: '6%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收货客户名称', dataIndex: 'buyerName2', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品款数', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' },
-        { title: '单据状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' },
-        { title: '财务打印状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' },
-        { title: '打印次数', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '创建时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'bizNo' }, width: '9%', align: 'center' },
+        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '9%', align: 'center' },
+        { title: '发货编号', dataIndex: 'sendNo', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'settleClientName', align: 'left', width: '10%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'receiverName', align: 'left', width: '10%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品款数', dataIndex: 'totalCategory', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center' },
+        { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
+
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(9, 0, { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },
   methods: {
+    changeTab (v) {
+      this.currentTab = v
+      this.resetSearchForm()
+    },
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
@@ -233,36 +272,46 @@ export default {
     shcustChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 详情
-    handleDetail (row, type) {
-      if (type == 0) {
-        this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn, type: 'pushOrder' } })
-      } else {
-        this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
-      }
+    // 销售单详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesDetail', params: { sn: row.bizSn, type: 'salesCollection' } })
     },
-    // 允许打印
+    // 备货单号
+    handleBhDetail (row) {
+      this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'salesCollection' } })
+    },
+    // 收款打印
     handlePrint (row) {
       this.tipData = row
       this.showTipModal = true
     },
     // 打印记录
     viewPrint (row) {
-      this.recordData = row
       this.showRecordModal = true
+      this.$refs.recordModal.setData(row, {
+        billType: 'ALLOCATE',
+        billSn: row.accountReceiptSn
+      })
     },
     // 重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
-      this.$refs.dealerSubareaScopeList.resetForm()
-      this.queryParam.salesBillNo = ''
-      this.queryParam.dispatchBillNo = ''
-      this.queryParam.billStatus = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.shippingAddrProvinceSn = undefined
+      this.time = []
+      this.$nextTick(() => {
+        this.$refs.rangeDate.resetDate(this.time)
+      })
+      this.queryParam = {
+        beginDate: '',
+        endDate: '',
+        bizNo: '',
+        dispatchBillNo: '',
+        settleClientName: '',
+        receiverName: '',
+        subareaSn: undefined,
+        billStatus: undefined,
+        voidFlag: undefined,
+        dealerProvinceSn: undefined,
+        printState: this.currentTab == 2 ? 'NO_PRINT' : undefined
+      }
       this.$refs.table.refresh(true)
     },
     pageInit () {
@@ -273,7 +322,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 250
+      this.tableHeight = window.innerHeight - tableSearchH - 270
     }
   },
   watch: {

+ 51 - 22
src/views/salesManagement/receiptPrint/recordModal.vue

@@ -11,22 +11,31 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main">
         <a-descriptions :column="2">
-          <a-descriptions-item label="销售单号">
-            {{ tipData&&tipData.buyerName }}
+          <a-descriptions-item label="调拨单号">
+            {{ tipData&&tipData.allocateNo }}
           </a-descriptions-item>
-          <a-descriptions-item label="备货单号">
-            {{ tipData&&tipData.buyerName }}
+          <a-descriptions-item label="调拨类型">
+            {{ tipData&&tipData.allocateTypeName }}
           </a-descriptions-item>
-          <a-descriptions-item label="客户名称">
-            {{ tipData&&tipData.buyerName }}
+          <a-descriptions-item label="调往对象">
+            {{ tipData&&tipData.targetName }}
           </a-descriptions-item>
           <a-descriptions-item label="收货客户名称">
-            {{ tipData&&tipData.buyerName }}
+            {{ tipData&&tipData.receiverName }}
           </a-descriptions-item>
         </a-descriptions>
         <div>
-          <a-table :columns="columns" :data-source="tableData" bordered>
-          </a-table>
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :defaultLoadData="false"
+            :scroll="{ y: 240 }"
+            bordered>
+          </s-table>
         </div>
         <div class="btn-box">
           <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
@@ -38,8 +47,9 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import { printLogQueryPage } from '@/api/data'
 export default {
-  name: 'CommonModal',
+  name: 'RecordModal',
   components: { STable, VSelect },
   props: {
     openModal: { //  弹框显示状态
@@ -64,23 +74,42 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       spinning: false,
-      detail: [],
-      queryParam: {
-
-      },
-      tableData: [],
+      tipData: null,
+      params: null,
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印时间', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印人', dataIndex: 'buyerName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: 'IP', dataIndex: 'buyerName1', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '打印方式', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ]
+        { title: '打印时间', dataIndex: 'printDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印人', dataIndex: 'printPersonName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: 'IP', dataIndex: 'printIp', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '打印方式', dataIndex: 'printType', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return printLogQueryPage(Object.assign(parameter, this.params || {})).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
     }
   },
   methods: {
-    setData (data) {
-      this.detail = data
+    setData (data, params) {
+      this.tipData = data
+      this.params = params
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
     },
     // 取消
     handleCommonCancel () {

+ 2 - 1
src/views/salesManagement/salesCollection/list.vue

@@ -289,6 +289,7 @@ export default {
     },
     columns () {
       const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', scopedSlots: { customRender: 'bizNo' }, width: '9%', align: 'center' },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '9%', align: 'center' },
@@ -307,7 +308,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(8, 0, { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }