lilei 3 éve
szülő
commit
cd27a68e0b

+ 7 - 3
src/views/common/commonModal.vue

@@ -8,13 +8,13 @@
     :title="modalTit"
     :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
     @cancle="isShow=false"
-    :width="416">
+    :width="width">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main" v-html="modalHtml"></div>
       <slot></slot>
       <div class="btn-box">
         <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
-        <a-button type="primary" class="button-primary" @click="handleCommonOk">{{ okText }}</a-button>
+        <a-button type="primary" @click="handleCommonOk">{{ okText }}</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -28,6 +28,10 @@ export default {
       type: Boolean,
       default: false
     },
+    width: {
+      type: String,
+      default: '500px'
+    },
     modalTit: { // 弹框标题
       type: String,
       default: null
@@ -108,7 +112,7 @@ export default {
       text-align: center;
       margin-top: 30px;
       .ant-btn{
-        margin:0 20px;
+        margin:0 10px;
       }
     }
   }

+ 3 - 35
src/views/salesManagement/examineVerify/list.vue

@@ -61,9 +61,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
                   <a-form-model-item prop="shippingAddrProvinceSn">
-                    <a-select id="examineVerifyList-shippingAddrProvinceSn" allowClear v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                    </a-select>
+                    <Area id="examineVerifyList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
                 </a-form-model-item>
               </a-col>
@@ -129,7 +127,7 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import { STable, VSelect } from '@/components'
@@ -139,7 +137,7 @@ import { dispatchlBhshList, dispatchQueryBhshCount, dispatchStockUpAduit } from
 export default {
   name: 'ExamineVerifyList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, auditModal, subarea, auditRejectModal },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, auditModal, subarea, auditRejectModal, Area },
   data () {
     return {
       spinning: false,
@@ -191,7 +189,6 @@ export default {
           return data
         })
       },
-      addrProvinceList: [], //  省下拉
       visibleAudit: false,
       visibleAuditReject: false,
       auditInfo: null,
@@ -295,40 +292,11 @@ export default {
     handleDetail (row) {
       this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'examineVerify' } })
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getArea('province')
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 308 - 3
src/views/salesManagement/matchSendOutOrder/list.vue

@@ -1,8 +1,313 @@
 <template>
+  <div class="matchSoo-wrap">
+    <a-card style="margin-top: 5px;" size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="创建时间">
+                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                </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="matchSoo-buyerName" @change="custChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="销售单号">
+                  <a-input id="matchSoo-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                </a-form-item>
+              </a-col>
+              <template v-if="advanced">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="备货单号">
+                    <a-input id="matchSoo-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="业务状态">
+                    <v-select
+                      v-model="queryParam.billStatus"
+                      ref="billStatus"
+                      id="matchSoo-billStatus"
+                      code="DISPATCH_BILL_STATUS"
+                      placeholder="请选择业务状态"
+                      allowClear></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="单据状态">
+                    <v-select
+                      v-model="queryParam.billStatus"
+                      ref="billStatus"
+                      id="matchSoo-billStatus"
+                      code="DISPATCH_BILL_STATUS"
+                      placeholder="请选择单据状态"
+                      allowClear></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="对单状态">
+                    <v-select
+                      v-model="queryParam.billStatus"
+                      ref="billStatus"
+                      id="matchSoo-billStatus"
+                      code="DISPATCH_BILL_STATUS"
+                      placeholder="请选择对单状态"
+                      allowClear></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="对单时间">
+                    <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="所在区域">
+                    <subarea id="matchSoo-subarea" v-model="queryParam.subareaSn"></subarea>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="地区">
+                    <a-form-model-item prop="shippingAddrProvinceSn">
+                      <Area id="matchSoo-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                    </a-form-model-item>
+                  </a-form-model-item>
+                  </a-form-model-item></a-col>
+              </template>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 8px">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :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>
+          <!-- 备货单号 -->
+          <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>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleAudit(record)"
+            >对单通过</a-button>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
 </template>
 
 <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'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import Area from '@/views/common/area.js'
+import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
+export default {
+  name: 'PushOrderManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, Area },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        buyerSn: undefined, //  客户名称
+        salesBillNo: '', //  销售单号
+        dispatchBillNo: '', //  备货单号
+        billStatus: undefined, //  业务状态
+        subareaSn: undefined,
+        shippingAddrProvinceSn: undefined
+      },
+      totalData: {
+        totalAmount: 0,
+        totalQty: 0,
+        totalRecord: 0
+      },
+      // 加载数据方法 必须为 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 => {
+          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
+        })
+      }
+    }
+  },
+  computed: {
+    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', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单人员', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    custChange (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' } })
+      }
+    },
+    // 允许打印
+    handleAudit (row) {
+      this.$confirm({
+        title: '操作提示',
+        content: '确认对单通过吗?',
+        centered: true,
+        onOk () {
+          console.log('OK')
+        }
+      })
+    },
+    // 重置
+    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.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 210
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
-
-<style>
-</style>
+<style lang="less">
+  .matchSoo-wrap{
+    .sTable{
+      margin-top: 10px;
+    }
+    .ant-tabs-bar{
+      margin:0;
+    }
+  }
+</style>

+ 161 - 0
src/views/salesManagement/outboundOrder/detailModal.vue

@@ -0,0 +1,161 @@
+<template>
+  <a-modal
+    centered
+    class="sendGood-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    @cancle="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <div class="toolsBar" v-if="detail.length">
+          <div>箭冠汽配西安大兴店,共 {{ detail && detail.length }} 个出库单,产品款数合计 <span>1266.45</span> ,产品数量合计 <span>158</span>。</div>
+        </div>
+        <div class="toolsBar">
+          发货时间:<a-date-picker v-model="sendDate" :locale="locale"/>
+        </div>
+        <div>
+          <a-table :columns="columns" :pagination="false" :data-source="tableData" bordered>
+            <!-- 物品名称 -->
+            <template slot="goodName" slot-scope="text, record">
+              <a-input v-model.trim="record.goodName"></a-input>
+            </template>
+            <!-- 数量 -->
+            <template slot="qty" slot-scope="text, record">
+              <a-input-number style="width: 100%;" v-model="record.qty" :min="1" :max="999999"></a-input-number>
+            </template>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record, index">
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record,index)"
+              >
+                删除
+              </a-button>
+            </template>
+          </a-table>
+          <div style="padding: 5px; border:1px solid #eee;border-radius:0 0 10px;border-top: 0;">
+            <a-button @click="addItem()" type="link" block>+新增发货明细</a-button>
+          </div>
+        </div>
+      </div>
+      <div class="btn-box">
+        <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button type="primary" @click="handleCommonOk">{{ okText }}</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import moment from 'moment'
+import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'CommonModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    okText: { // 确定 按钮文字
+      type: String,
+      default: '确定'
+    },
+    cancelText: { // 取消 按钮文字
+      type: String,
+      default: '取消'
+    },
+    isCancel: { // 是否显示  取消 按钮
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      locale,
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      detail: [],
+      sendDate: moment(),
+      tableData: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货物名称', dataIndex: 'goodName', scopedSlots: { customRender: 'goodName' }, width: '50%', align: 'center' },
+        { title: '件数', dataIndex: 'qty', scopedSlots: { customRender: 'qty' }, width: '25%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+      ]
+    }
+  },
+  methods: {
+    setData (data) {
+      this.detail = data
+    },
+    // 删除
+    handleDel (row, index) {
+      this.tableData.splice(index, 1)
+    },
+    // 添加
+    addItem () {
+      const len = this.tableData.length
+      this.tableData.push({
+        no: len + 1,
+        goodName: '',
+        qty: 1
+      })
+    },
+    // 确定
+    handleCommonOk () {
+      this.$emit('ok')
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('cancel')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .sendGood-detail-modal{
+    .common-main{
+       .toolsBar{
+         display: flex;
+         align-items: center;
+         margin-bottom: 10px;
+         .ant-btn{
+           margin-left: 30px;
+         }
+       }
+    }
+    .btn-box{
+      text-align: center;
+      margin-top: 30px;
+      .ant-btn{
+        margin:0 10px;
+      }
+    }
+  }
+</style>

+ 37 - 74
src/views/salesManagement/outboundOrder/list.vue

@@ -56,9 +56,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
                   <a-form-model-item prop="shippingAddrProvinceSn">
-                    <a-select id="outboundOrderList-shippingAddrProvinceSn" allowClear v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                    </a-select>
+                    <Area id="outboundOrderList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
                 </a-form-model-item>
               </a-col>
@@ -130,6 +128,8 @@
         <allocationDetailModal v-if="outBizType=='ALLOCATE'" :outBizSn="orderSn" />
       </div>
     </a-modal>
+    <!-- 发货信息 -->
+    <detailModal ref="detailModal" modalTit="发货信息" :openModal="showDetailModal" @cancel="showDetailModal=false"></detailModal>
   </a-card>
 </template>
 
@@ -139,15 +139,16 @@ import moment from 'moment'
 import rangeDate from '@/views/common/rangeDate.vue'
 import getDate from '@/libs/getDate.js'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import pushOrderDetailModal from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
+import detailModal from './detailModal.vue'
 import { STable, VSelect } from '@/components'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
 export default {
   name: 'OutboundOrderList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, pushOrderDetailModal, allocationDetailModal, subarea },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, allocationDetailModal, subarea, Area, detailModal },
   data () {
     return {
       spinning: false,
@@ -188,11 +189,11 @@ export default {
           return data
         })
       },
-      addrProvinceList: [], //  省下拉
       openModal: false,
       orderSn: undefined,
       outBizType: null, //  当前单子类型   SALES销售出库        ALLOCATE调拨出库
-      rowSelectionInfo: null
+      rowSelectionInfo: null,
+      showDetailModal: false
     }
   },
   computed: {
@@ -273,82 +274,45 @@ export default {
     // 出库/批量出库
     handleOutbound (row) {
       const _this = this
-      let content = ''
-      let params = []
       if (row) { //  单个出库
-        content = '确认要出库吗?'
-        params = [{
-          stockOutSn: row.stockOutSn,
-          outBizSn: row.outBizSn,
-          outBizSubSn: row.outBizSubSn,
-          outBizType: row.outBizType
-        }]
+        this.showDetailModal = true
+        this.$refs.detailModal.setData([row], 0)
       } else { //  批量出库
-        content = '确认要批量出库吗?'
-        if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
-          this.$message.warning('请在列表勾选后再进行批量操作!')
+        const slen = _this.rowSelectionInfo.selectedRowKeys.length
+        if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
+          _this.$message.warning('请在列表勾选后再进行批量操作!')
           return
         }
-        params = []
-        this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.map(item => {
-          params.push({
-            stockOutSn: item.stockOutSn,
-            outBizSn: item.outBizSn,
-            outBizSubSn: item.outBizSubSn,
-            outBizType: item.outBizType
-          })
-        })
-      }
-      this.$confirm({
-        title: '提示',
-        content: content,
-        centered: true,
-        onOk () {
-          if (!row) { //  批量出库
-            _this.loading = true
-          }
-          _this.spinning = true
-          stockOutOut(params).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              if (!row) { //  批量出库
-                _this.$refs.table.clearSelected() // 清空表格选中项
-              }
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
+        // 判断是否选择相同的客户
+        const demanderName = _this.rowSelectionInfo.selectedRows[0].demanderName
+        const haseq = _this.rowSelectionInfo.selectedRows.filter(item => item.demanderName == demanderName)
+        if (haseq.length == slen) {
+          this.showDetailModal = true
+          this.$refs.detailModal.setData(_this.rowSelectionInfo.selectedRows, 1)
+        } else {
+          this.$info({
+            title: '操作提示',
+            centered: true,
+            content: '您所选择的出库单,不属于同一个客户,无法批量出库,请重新选择。只能针对一个客户的出库单进行批量出库。'
           })
         }
-      })
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
-      getArea(params).then(res => {
+    },
+    // 出库
+    outBound (params, row) {
+      const _this = this
+      _this.spinning = true
+      stockOutOut(params).then(res => {
+        _this.loading = false
         if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
+          if (!row) { //  批量出库
+            _this.$refs.table.clearSelected() // 清空表格选中项
           }
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
         } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
+          _this.spinning = false
         }
       })
     },
@@ -357,7 +321,6 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getArea('province')
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },

+ 65 - 38
src/views/salesManagement/pushOrderManagement/list.vue

@@ -16,7 +16,7 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="关联销售单号">
+              <a-form-item label="销售单号">
                 <a-input id="pushOrder-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
@@ -26,6 +26,11 @@
                   <a-input id="pushOrder-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
                 </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="shbuyerName" id="pushOrder-shbuyerName" @change="shcustChange" />
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
@@ -37,6 +42,28 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="pushOrder-billStatus"
+                    code="DISPATCH_BILL_STATUS"
+                    placeholder="请选择单据状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="备货打印状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="pushOrder-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="pushOrder-subarea" v-model="queryParam.subareaSn"></subarea>
@@ -45,9 +72,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
                   <a-form-model-item prop="shippingAddrProvinceSn">
-                    <a-select id="pushOrder-shippingAddrProvinceSn" allowClear v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                    </a-select>
+                    <Area id="pushOrder-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
                 </a-form-model-item>
               </a-col>
@@ -95,7 +120,27 @@
           <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
           <span v-else>{{ record.dispatchBillNo }}</span>
         </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            @click="handlePrint(record)"
+          >允许备货打印</a-button>
+        </template>
       </s-table>
+
+      <!-- 操作提示 -->
+      <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="showTipModal=false">
+        <div style="text-align: center;">
+          <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认允许此单进行备货打印吗?</strong></div>
+          <div style="line-height: 24px;">
+            <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
+            <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
+          </div>
+        </div>
+      </commonModal>
     </a-spin>
   </a-card>
 </template>
@@ -107,13 +152,14 @@ 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'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import commonModal from '@/views/common/commonModal.vue'
 import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
 export default {
   name: 'PushOrderManagementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, Area },
   data () {
     return {
       spinning: false,
@@ -140,6 +186,8 @@ export default {
         totalQty: 0,
         totalRecord: 0
       },
+      showTipModal: false,
+      tipData: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -161,8 +209,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      addrProvinceList: [] //  省下拉
+      }
     }
   },
   computed: {
@@ -177,7 +224,8 @@ export default {
         // { title: '下推金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '备货时间', dataIndex: 'stockUpDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库时间', dataIndex: 'stockOutDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' }
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
         arr.splice(6, 0, { title: '下推金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -194,6 +242,9 @@ export default {
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
+    shcustChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
     // 详情
     handleDetail (row, type) {
       if (type == 0) {
@@ -202,6 +253,11 @@ export default {
         this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
       }
     },
+    // 允许打印
+    handlePrint (row) {
+      this.tipData = row
+      this.showTipModal = true
+    },
     // 重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
@@ -216,40 +272,11 @@ export default {
       this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.table.refresh(true)
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getArea('province')
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 317 - 3
src/views/salesManagement/receiptPrint/list.vue

@@ -1,8 +1,322 @@
 <template>
+  <div class="receiptPrint-wrap">
+    <div style="background-color: #fff;">
+      <a-tabs default-active-key="2">
+        <a-tab-pane key="1" tab="全部">
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="待打印">
+        </a-tab-pane>
+      </a-tabs>
+    </div>
+    <a-card style="margin-top: 5px;" size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="创建时间">
+                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                </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>
+              </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-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-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="业务状态">
+                    <v-select
+                      v-model="queryParam.billStatus"
+                      ref="billStatus"
+                      id="receiptPrint-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-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-col>
+              </template>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 8px">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :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>
+          <!-- 备货单号 -->
+          <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>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="viewPrint(record)"
+            >打印记录</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handlePrint(record)"
+            >收款打印</a-button>
+          </template>
+        </s-table>
+
+        <!-- 操作提示 -->
+        <commonModal modalTit="收款打印" :openModal="showTipModal" @cancel="showTipModal=false">
+          <div style="line-height: 30px;">
+            <div>销售单号:{{ tipData&&tipData.buyerName }}</div>
+            <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
+            <div>发货编号:{{ tipData&&tipData.buyerName }}</div>
+            <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
+            <div>收货客户名称:{{ tipData&&tipData.buyerName }}</div>
+            <div>产品分类:{{ tipData&&tipData.buyerName }}</div>
+          </div>
+        </commonModal>
+
+        <!-- 打印记录 -->
+        <recordModal modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
+      </a-spin>
+    </a-card>
+  </div>
 </template>
 
 <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'
+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'
+export default {
+  name: 'PushOrderManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, recordModal, Area },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        buyerSn: undefined, //  客户名称
+        salesBillNo: '', //  销售单号
+        dispatchBillNo: '', //  备货单号
+        billStatus: undefined, //  业务状态
+        subareaSn: undefined,
+        shippingAddrProvinceSn: undefined
+      },
+      totalData: {
+        totalAmount: 0,
+        totalQty: 0,
+        totalRecord: 0
+      },
+      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 => {
+          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
+        })
+      }
+    }
+  },
+  computed: {
+    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: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    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' } })
+      }
+    },
+    // 允许打印
+    handlePrint (row) {
+      this.tipData = row
+      this.showTipModal = true
+    },
+    // 打印记录
+    viewPrint (row) {
+      this.recordData = row
+      this.showRecordModal = true
+    },
+    // 重置
+    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.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 250
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
-
-<style>
-</style>
+<style lang="less">
+  .receiptPrint-wrap{
+    .sTable{
+      margin-top: 10px;
+    }
+    .ant-tabs-bar{
+      margin:0;
+    }
+  }
+</style>

+ 117 - 0
src/views/salesManagement/receiptPrint/recordModal.vue

@@ -0,0 +1,117 @@
+<template>
+  <a-modal
+    centered
+    class="record-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    @cancle="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <a-descriptions :column="2">
+          <a-descriptions-item label="销售单号">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+          <a-descriptions-item label="备货单号">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+          <a-descriptions-item label="客户名称">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+          <a-descriptions-item label="收货客户名称">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+        </a-descriptions>
+        <div>
+          <a-table :columns="columns" :data-source="tableData" bordered>
+          </a-table>
+        </div>
+        <div class="btn-box">
+          <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'CommonModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    cancelText: { // 取消 按钮文字
+      type: String,
+      default: '关闭'
+    },
+    isCancel: { // 是否显示  取消 按钮
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      detail: [],
+      queryParam: {
+
+      },
+      tableData: [],
+      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 }
+      ]
+    }
+  },
+  methods: {
+    setData (data) {
+      this.detail = data
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('cancel')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .record-detail-modal{
+    .common-main{
+      .btn-box{
+        text-align: center;
+        margin-top: 30px;
+        .ant-btn{
+          margin:0 10px;
+        }
+      }
+    }
+  }
+</style>

+ 0 - 8
src/views/salesManagement/salesCollection/detail.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 235 - 0
src/views/salesManagement/salesCollection/detailModal.vue

@@ -0,0 +1,235 @@
+<template>
+  <a-modal
+    centered
+    class="collection-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
+    @cancle="isShow=false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <div class="toolsBar">
+          <div v-if="detail.length">箭冠汽配西安大兴店,共 {{ detail && detail.length }} 个备货单,合计 1266.45 元,已选择 2 个收款单</div>
+          <a-button type="primary" class="button-primary" @click="handleCommonOk">{{ okText }}</a-button>
+        </div>
+        <div>
+          <a-table :columns="chooseColumns" :pagination="false" :data-source="chooseData" bordered>
+            <!-- 收款单号 -->
+            <template slot="salesBillNo" slot-scope="text, record">
+              <span class="link-bule">{{ record.salesBillNo }}</span>
+            </template>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+            </template>
+          </a-table>
+        </div>
+      </div>
+      <a-divider>请选择收款单</a-divider>
+      <div class="common-main">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="收款单号">
+                  <a-input v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入收款单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="财务收款事由">
+                  <a-input v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入财务收款事由"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="申请人">
+
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 表格数据 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 销售单号 -->
+          <template slot="salesBillNo" slot-scope="text, record">
+            <span class="link-bule">{{ record.salesBillNo }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleChoose(record)"
+            >选择</a-button>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { salesList } from '@/api/sales'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'CommonModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    okText: { // 确定 按钮文字
+      type: String,
+      default: '确定收款'
+    },
+    cancelText: { // 取消 按钮文字
+      type: String,
+      default: '取消'
+    },
+    isCancel: { // 是否显示  取消 按钮
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      detail: [],
+      queryParam: {
+
+      },
+      // 已选列
+      chooseColumns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款单号', scopedSlots: { customRender: 'salesBillNo' }, width: '7%', align: 'center' },
+        { title: '申请人', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '财务收款事由', dataIndex: 'buyerName', width: '8%', 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: 'totalPushedAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ],
+      chooseData: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款单号', scopedSlots: { customRender: 'salesBillNo' }, width: '7%', align: 'center' },
+        { title: '申请人', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '财务收款事由', dataIndex: 'buyerName1', width: '8%', 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: 'totalPushedAmount', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return salesList(Object.assign(parameter, this.queryParam)).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
+    },
+    // 删除
+    handleDel (row) {
+
+    },
+    // 选择
+    handleChoose (row) {
+
+    },
+    // 确定
+    handleCommonOk () {
+      this.$emit('ok')
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    },
+    // 重置
+    resetSearchForm () {
+
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('cancel')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .collection-detail-modal{
+    .common-main{
+       .toolsBar{
+         display: flex;
+         align-items: center;
+         margin-bottom: 10px;
+         .ant-btn{
+           margin-left: 30px;
+         }
+       }
+    }
+  }
+</style>

+ 37 - 88
src/views/salesManagement/salesCollection/list.vue

@@ -107,25 +107,9 @@
                   <a-form-item label="地区">
                     <a-col span="24">
                       <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
+                        <Area id="salesCollectionList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
                       </a-form-item>
                     </a-col>
-                    <!-- <a-col span="7" offset="1">
-                      <a-form-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-item>
-                    </a-col> -->
                   </a-form-item>
                 </a-row>
               </a-col>
@@ -195,14 +179,19 @@
           <div v-if="handlePlData.length">箭冠汽配西安大兴店,共 {{ handlePlData && handlePlData.length }} 个备货单,合计 1266.45 元</div>
           <div style="padding: 15px 0;font-weight: bold;">请选择收款类型</div>
           <div>
-            <v-select
-              v-model="queryParam.settleType"
-              showType="radio"
-              code="SALES_SOURCE"
-            ></v-select>
+            <a-radio-group v-model="collectionType">
+              <a-radio :value="1">
+                关联收款单
+              </a-radio>
+              <a-radio :value="0">
+                仅标记收款
+              </a-radio>
+            </a-radio-group>
           </div>
         </div>
       </commonModal>
+      <!-- 发货信息 -->
+      <detailModal ref="detailModal" modalTit="发货信息" :openModal="showDetail" @cancel="showDetail=false"></detailModal>
     </a-spin>
   </a-card>
 </template>
@@ -214,17 +203,18 @@ import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import commonModal from '@/views/common/commonModal.vue'
+import detailModal from './detailModal.vue'
 import { settleReceiptList, settleReceipt } from '@/api/settleReceipt'
 export default {
   name: 'SalesCollectionList',
   mixins: [commonMixin],
-  components: { STable, VSelect, subarea, rangeDate, commonModal },
+  components: { STable, VSelect, subarea, rangeDate, commonModal, detailModal, Area },
   data () {
     return {
       spinning: false,
-      showTipModal: false,
+      showDetail: false,
       showSkModal: false,
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -271,11 +261,9 @@ export default {
         })
       },
       total: 0, // 合计
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      rowSelectionInfo: null,
-      handlePlData: []
+      rowSelectionInfo: null, // 批量选择的数据
+      handlePlData: [], // 收款临时数据
+      collectionType: 1 // 收款类型
     }
   },
   // 根据权限显示列表字段
@@ -291,13 +279,13 @@ export default {
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '10%', align: 'center' },
         { title: '发货编号', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '客户名称', dataIndex: 'settleClientName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收货客户名称', dataIndex: 'settleClientName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'settleClientName1', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'dealerLevelDictValue', 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: 'qty1', 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: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款方式', dataIndex: 'settleStyleDictValue1', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -383,71 +371,32 @@ export default {
       this.handlePlData = [row]
       this.showSkModal = true
     },
+    // 收款
     handleSaveColle (row) {
       const _this = this
-      _this.spinning = true
-      settleReceipt({ sn: row.accountReceiptSn }).then(res => {
-        if (res.status == 200) {
-          _this.$message.success(res.message)
-          _this.$refs.table.refresh()
-          _this.spinning = false
-        } else {
-          _this.spinning = false
-        }
-      })
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
+      // 关联收款
+      if (this.collectionType == 1) {
+        this.showDetail = true
+        this.$refs.detailModal.setData(this.handlePlData)
+        this.showSkModal = false
       } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
+        _this.spinning = true
+        settleReceipt({ sn: row.accountReceiptSn }).then(res => {
+          if (res.status == 200) {
+            _this.$message.success(res.message)
+            _this.$refs.table.refresh()
+            _this.spinning = false
+          } else {
+            _this.spinning = false
           }
-        }
-      })
+        })
+      }
     },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.getArea('province')
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 0 - 8
src/views/salesManagement/sendOutOrder/detail.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 162 - 0
src/views/salesManagement/sendOutOrder/detailModal.vue

@@ -0,0 +1,162 @@
+<template>
+  <a-modal
+    centered
+    class="sendGood-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    @cancle="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <div class="toolsBar" v-if="detail">
+          <div>箭冠汽配西安大兴店,共 {{ detail && detail.length }} 个出库单,产品款数合计 <span>1266.45</span> ,产品数量合计 <span>158</span>。</div>
+        </div>
+        <div>
+          <a-table :columns="outColumns" :pagination="false" :data-source="outTableData" bordered></a-table>
+        </div>
+        <div class="toolsBar forms">
+          <div>发货时间:2022-02-14</div>
+          <div>物流情况:
+            <a-radio-group>
+              <a-radio :value="1">
+                正常
+              </a-radio>
+              <a-radio :value="0">
+                异常
+              </a-radio>
+            </a-radio-group>
+          </div>
+          <div>是否收货:<div><a-checkbox>已收货</a-checkbox></div></div>
+          <div>收货时间:<a-date-picker format="YYYY-MM-DD" v-model="form.sendDate"/></div>
+          <div><label>备注:</label><a-input v-model="form.remark" placeholder="请输入备注"/></div>
+        </div>
+        <div>
+          <a-table :columns="columns" :pagination="false" :data-source="tableData" bordered></a-table>
+        </div>
+      </div>
+      <div class="btn-box">
+        <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button type="primary" @click="handleCommonOk">{{ okText }}</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'CommonModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    okText: { // 确定 按钮文字
+      type: String,
+      default: '保存'
+    },
+    cancelText: { // 取消 按钮文字
+      type: String,
+      default: '取消'
+    },
+    isCancel: { // 是否显示  取消 按钮
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      detail: null,
+      form: {
+        remark: ''
+      },
+      tableData: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货物名称', dataIndex: 'goodName', width: '50%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '件数', dataIndex: 'qty', width: '25%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      outTableData: [],
+      outColumns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库单号', dataIndex: 'goodName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务单号', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库类型', dataIndex: 'goodName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货编号', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货客户名称', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品款数', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+    }
+  },
+  methods: {
+    setData (data) {
+      this.detail = data
+    },
+    // 确定
+    handleCommonOk () {
+      this.$emit('ok')
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('cancel')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .sendGood-detail-modal{
+    .common-main{
+       .toolsBar{
+         display: flex;
+         align-items: center;
+         margin: 10px;
+       }
+       .forms{
+         flex-wrap: wrap;
+       }
+       .forms > div{
+         flex-grow: 1;
+         flex-basis: 50%;
+         padding: 10px;
+         display: flex;
+         align-items: center;
+         > label{
+           flex-basis: 50px;
+         }
+       }
+    }
+    .btn-box{
+      text-align: center;
+      margin-top: 30px;
+      .ant-btn{
+        margin:0 10px;
+      }
+    }
+  }
+</style>

+ 295 - 3
src/views/salesManagement/sendOutOrder/list.vue

@@ -1,8 +1,300 @@
 <template>
+  <a-card size="small" :bordered="false" class="sendOut-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              </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="sendOut-buyerName" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销售单号">
+                <a-input id="sendOut-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="备货单号">
+                  <a-input id="sendOut-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                </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="shbuyerName" id="sendOut-shbuyerName" @change="shcustChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="sendOut-billStatus"
+                    code="DISPATCH_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="sendOut-billStatus"
+                    code="DISPATCH_BILL_STATUS"
+                    placeholder="请选择单据状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="备货打印状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="sendOut-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="sendOut-subarea" v-model="queryParam.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                  <a-form-model-item prop="shippingAddrProvinceSn">
+                    <Area id="sendOut-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                  </a-form-model-item>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 发货单号 -->
+        <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>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            @click="handleEdit(record)"
+          >编辑</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 编辑发货单 -->
+    <detailModal ref="detailModal" :openModal="showTipModal" modalTit="发货单详情" @cancel="showTipModal=false"></detailModal>
+  </a-card>
 </template>
 
 <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'
+import Area from '@/views/common/area.js'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import detailModal from './detailModal.vue'
+import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
+export default {
+  name: 'PushOrderManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, detailModal, Area },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        buyerSn: undefined, //  客户名称
+        salesBillNo: '', //  销售单号
+        dispatchBillNo: '', //  备货单号
+        billStatus: undefined, //  业务状态
+        subareaSn: undefined,
+        shippingAddrProvinceSn: undefined
+      },
+      totalData: {
+        totalAmount: 0,
+        totalQty: 0,
+        totalRecord: 0
+      },
+      showTipModal: false,
+      // 加载数据方法 必须为 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 => {
+          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
+        })
+      }
+    }
+  },
+  computed: {
+    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: 'dispatchBillNo' }, width: '14%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '发货时间', dataIndex: 'stockUpDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总件数', dataIndex: 'totalQty', 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: 'stockOutDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流情况', dataIndex: 'billStatusDictValue1', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'billStatusDictValue2', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    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' } })
+      }
+    },
+    // 编辑
+    handleEdit (row) {
+      this.showTipModal = true
+      this.$refs.detailModal.setData(row)
+    },
+    // 重置
+    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.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 210
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
-
-<style>
-</style>
+<style lang="less">
+  .sendOut-wrap{
+    .sTable{
+      margin-top: 10px;
+    }
+  }
+</style>

+ 337 - 3
src/views/salesManagement/stockPrint/list.vue

@@ -1,8 +1,342 @@
 <template>
+  <div class="stockPrint-wrap">
+    <div style="background-color: #fff;">
+      <a-tabs default-active-key="2">
+        <a-tab-pane key="1" tab="全部">
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="待打印">
+        </a-tab-pane>
+      </a-tabs>
+    </div>
+    <a-card style="margin-top: 5px;" size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="创建时间">
+                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                </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="stockPrint-buyerName" @change="custChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="销售单号">
+                  <a-input id="stockPrint-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                </a-form-item>
+              </a-col>
+              <template v-if="advanced">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="备货单号">
+                    <a-input id="stockPrint-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                  </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="shbuyerName" id="stockPrint-shbuyerName" @change="shcustChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="业务状态">
+                    <v-select
+                      v-model="queryParam.billStatus"
+                      ref="billStatus"
+                      id="stockPrint-billStatus"
+                      code="DISPATCH_BILL_STATUS"
+                      placeholder="请选择业务状态"
+                      allowClear></v-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="单据状态">
+                    <v-select
+                      v-model="queryParam.billStatus"
+                      ref="billStatus"
+                      id="stockPrint-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="stockPrint-subarea" v-model="queryParam.subareaSn"></subarea>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="地区">
+                    <a-form-model-item prop="shippingAddrProvinceSn">
+                      <Area id="stockPrint-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                    </a-form-model-item>
+                  </a-form-model-item>
+                </a-col>
+              </template>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 8px">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :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>
+          <!-- 备货单号 -->
+          <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>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="viewPrint(record)"
+            >打印记录</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handlePrint(record)"
+            >发货分类打印</a-button>
+          </template>
+        </s-table>
+
+        <!-- 操作提示 -->
+        <commonModal modalTit="发货分类打印" :openModal="showTipModal" @cancel="showTipModal=false">
+          <div style="line-height: 30px;">
+            <div>销售单号:{{ tipData&&tipData.buyerName }}</div>
+            <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
+            <div>发货编号:{{ tipData&&tipData.buyerName }}</div>
+            <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
+            <div>收货客户名称:{{ tipData&&tipData.buyerName }}</div>
+            <div>产品分类:{{ tipData&&tipData.buyerName }}</div>
+          </div>
+        </commonModal>
+
+        <!-- 打印记录 -->
+        <recordModal modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
+      </a-spin>
+    </a-card>
+  </div>
 </template>
 
 <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'
+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'
+export default {
+  name: 'PushOrderManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, recordModal, Area },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        buyerSn: undefined, //  客户名称
+        salesBillNo: '', //  销售单号
+        dispatchBillNo: '', //  备货单号
+        billStatus: undefined, //  业务状态
+        subareaSn: undefined,
+        shippingAddrProvinceSn: undefined
+      },
+      totalData: {
+        totalAmount: 0,
+        totalQty: 0,
+        totalRecord: 0
+      },
+      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 => {
+          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
+        })
+      }
+    }
+  },
+  computed: {
+    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: 'totalAmount', 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: 'totalAmount', 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: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货打印状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    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' } })
+      }
+    },
+    // 允许打印
+    handlePrint (row) {
+      this.tipData = row
+      this.showTipModal = true
+    },
+    // 打印记录
+    viewPrint (row) {
+      this.recordData = row
+      this.showRecordModal = true
+    },
+    // 重置
+    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.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 250
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
-
-<style>
-</style>
+<style lang="less">
+  .stockPrint-wrap{
+    .sTable{
+      margin-top: 10px;
+    }
+    .ant-tabs-bar{
+      margin:0;
+    }
+  }
+</style>

+ 117 - 0
src/views/salesManagement/stockPrint/recordModal.vue

@@ -0,0 +1,117 @@
+<template>
+  <a-modal
+    centered
+    class="record-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    @cancle="isShow=false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <a-descriptions :column="2">
+          <a-descriptions-item label="销售单号">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+          <a-descriptions-item label="备货单号">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+          <a-descriptions-item label="客户名称">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+          <a-descriptions-item label="收货客户名称">
+            {{ tipData&&tipData.buyerName }}
+          </a-descriptions-item>
+        </a-descriptions>
+        <div>
+          <a-table :columns="columns" :data-source="tableData" bordered>
+          </a-table>
+        </div>
+        <div class="btn-box">
+          <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'CommonModal',
+  components: { STable, VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    cancelText: { // 取消 按钮文字
+      type: String,
+      default: '关闭'
+    },
+    isCancel: { // 是否显示  取消 按钮
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      detail: [],
+      queryParam: {
+
+      },
+      tableData: [],
+      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 }
+      ]
+    }
+  },
+  methods: {
+    setData (data) {
+      this.detail = data
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('cancel')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .record-detail-modal{
+    .common-main{
+      .btn-box{
+        text-align: center;
+        margin-top: 30px;
+        .ant-btn{
+          margin:0 10px;
+        }
+      }
+    }
+  }
+</style>

+ 36 - 45
src/views/salesManagement/waitDispatch/dsModal.vue

@@ -19,22 +19,25 @@
           :label-col="formItemLayout.labelCol"
           :wrapper-col="formItemLayout.wrapperCol"
         >
-          <a-form-model-item label="客户名称" prop="tenantSn">
-            <span>{{ detailData ? (detailData.org ? detailData.org.name : '--') : '--' }}</span>
+          <a-form-model-item label="客户名称">
+            <span>{{ detailData ? detailData.buyerName : '--' }}</span>
           </a-form-model-item>
-          <a-form-model-item label="收货客户名称" prop="name" extra="如果收货客户和下单客户相同,则不需要选择收货客户名称">
+          <a-form-model-item label="收货客户名称" extra="如果收货客户和下单客户相同,则不需要选择收货客户名称">
             <custList ref="custList" @change="custChange"></custList>
           </a-form-model-item>
-          <a-form-model-item label="发货编号" prop="phone">
+          <a-form-model-item label="发货编号" prop="sendNo">
             <a-input
               id="dealerAccountEdit-phone"
               :maxLength="11"
-              v-model.trim="form.phone"
+              v-model.trim="form.sendNo"
               placeholder="请输入发货编号"
               allowClear />
+            <div style="height: 24px;line-height: normal;">
+              常用:<a-button size="small" type="link" v-for="i in 5">{{ i }}</a-button>
+            </div>
           </a-form-model-item>
-          <a-form-model-item label="备货打印" prop="org.childUserMaxNum">
-            <a-radio-group>
+          <a-form-model-item label="备货打印" prop="print">
+            <a-radio-group v-model="form.print">
               <a-radio :value="1">
                 允许打印
               </a-radio>
@@ -56,7 +59,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import custList from '@/views/common/custList.vue'
-import { dealerUserSave, dealerUserDetail } from '@/api/dealer'
+import { dealerUserSave } from '@/api/dealer'
 export default {
   name: 'DealerAccountEditModal',
   mixins: [commonMixin],
@@ -80,25 +83,22 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        tenantSn: '',
-        name: '',
-        phone: '',
-        loginName: '',
-        password: '',
-        org: {
-          childUserMaxNum: ''
-        }
+        sendNo: '',
+        print: '',
+        buyerName: '',
+        shbuyerName: ''
       },
       rules: {
-        tenantSn: [{ required: true, message: '请选择经销商', trigger: 'change' }],
-        name: [{ required: true, message: '请输入管理员姓名', trigger: 'blur' }]
+        sendNo: [{ required: true, message: '请输入发货编号', trigger: 'change' }],
+        print: [{ required: true, message: '请选择备货打印', trigger: 'blur' }]
       },
       detailData: null //  详情数据
     }
   },
   methods: {
     custChange (val) {
-      this.form.tenantSn = val.key
+      this.form.shbuyerNameSn = val.key || ''
+      this.form.shbuyerName = val.row && val.row.buyerName || ''
     },
     //  保存
     handleSave () {
@@ -127,22 +127,22 @@ export default {
       })
     },
     //  获取详情
-    getDetail () {
-      dealerUserDetail({ id: this.itemId }).then(res => {
-        if (res.status == 200) {
-          this.detailData = res.data
-          this.form.tenantSn = this.detailData.tenantSn || ''
-          this.form.name = this.detailData.name || ''
-          this.form.phone = this.detailData.phone || ''
-          this.form.loginName = this.detailData.loginName || ''
-          this.form.password = this.detailData.password || ''
-          const childUserMaxNum = this.detailData ? (this.detailData.org ? (this.detailData.org.childUserMaxNum ? this.detailData.org.childUserMaxNum : '') : '') : ''
-          this.form.org.childUserMaxNum = childUserMaxNum
-        } else {
-          this.detailData = null
-          this.$refs.ruleForm.resetFields()
-        }
-      })
+    setDetail (data) {
+      this.detailData = data
+    },
+    // 重置表单
+    resetForm () {
+      this.detailData = null
+      this.$refs.ruleForm.resetFields()
+      this.form.tenantSn = ''
+      this.form.name = ''
+      this.form.phone = ''
+      this.form.loginName = ''
+      this.form.password = ''
+      this.form.org.childUserMaxNum = ''
+      if (this.itemId == '') {
+        this.$refs.custList.resetForm()
+      }
     }
   },
   watch: {
@@ -154,16 +154,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.$refs.ruleForm.resetFields()
-        this.form.tenantSn = ''
-        this.form.name = ''
-        this.form.phone = ''
-        this.form.loginName = ''
-        this.form.password = ''
-        this.form.org.childUserMaxNum = ''
-        if (this.itemId == '') {
-          this.$refs.custList.resetForm()
-        }
+        this.resetForm()
       }
     },
     itemId (newValue, oldValue) {

+ 19 - 13
src/views/salesManagement/waitDispatch/edit.vue

@@ -16,6 +16,8 @@
           @oneDispatch="oneDispatch"
           @cancelProduct="cancelProduct"
           @addProduct="insterProduct"></queryPart>
+        <!-- 一键下推 -->
+        <dsModal ref="dsModal" :openModal="showDsModal" @close="showDsModal=false" />
       </a-card>
       <a-card size="small" :bordered="false" class="waitDispatch-cont">
         <div slot="title">
@@ -106,6 +108,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
+import dsModal from './dsModal.vue'
 import { salesDetailBySn } from '@/api/sales'
 import { salesDetailDispatchByOneKey, insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetail'
 import { deleteBatch, pushDown, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
@@ -113,9 +116,10 @@ import { findBySalesBillSn } from '@/api/dispatch'
 export default {
   name: 'WaitDispatch',
   mixins: [commonMixin],
-  components: { STable, VSelect, queryPart },
+  components: { STable, VSelect, queryPart, dsModal },
   data () {
     return {
+      showDsModal: false,
       spinning: false,
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
@@ -312,18 +316,20 @@ export default {
     },
     // 一键下推
     oneDispatch () {
-      this.isInster = true
-      this.spinning = true
-      salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm()
-          this.$refs.partQuery.resetCurForm()
-          this.spinning = false
-        } else {
-          this.spinning = false
-        }
-        this.isInster = false
-      })
+      this.showDsModal = true
+      this.$refs.dsModal.setDetail(this.detailData)
+      // this.isInster = true
+      // this.spinning = true
+      // salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
+      //   if (res.status == 200) {
+      //     this.resetSearchForm()
+      //     this.$refs.partQuery.resetCurForm()
+      //     this.spinning = false
+      //   } else {
+      //     this.spinning = false
+      //   }
+      //   this.isInster = false
+      // })
     },
     //  销售单详情
     getOrderDetail () {

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

@@ -54,7 +54,7 @@
     <div class="table-operator">
       <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
       <a-button type="danger" :disabled="newLoading" class="button-error" @click="handlePlCancel">批量取消</a-button>
-      <a-button type="default" :disabled="newLoading" @click="showDsModal=true">有货一键下推</a-button>
+      <a-button type="default" :disabled="newLoading" @click="handleOneDispatch">有货一键下推</a-button>
     </div>
     <!-- alert -->
     <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData">
@@ -120,18 +120,16 @@
         <span v-else>--</span>
       </template>
     </s-table>
-    <!-- 一键下推 -->
-    <dsModal :openModal="showDsModal" @close="showDsModal=false" />
+
   </div>
 </template>
 
 <script>
 import { salesDetailAllStockList } from '@/api/salesDetail'
 import { STable, VSelect } from '@/components'
-import dsModal from './dsModal.vue'
 export default {
   name: 'QueryPart',
-  components: { STable, VSelect, dsModal },
+  components: { STable, VSelect },
   props: {
     newLoading: Boolean
   },
@@ -142,7 +140,6 @@ export default {
   },
   data () {
     return {
-      showDsModal: false,
       advanced: true, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
       productType: [],
@@ -316,16 +313,7 @@ export default {
     },
     // 一键下推
     handleOneDispatch () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定后,所有有货的产品将自动添加到待下推列表,确定要进行有货一键下推吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.$emit('oneDispatch')
-        }
-      })
+      this.$emit('oneDispatch')
     },
     //  产品分类  change
     changeProductType (val, opt) {