Browse Source

货架订单

lilei 2 years ago
parent
commit
5658ebd8a8

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
 {
   "message": "发现有新版本发布,确定更新系统?",
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
   "vendorJsVersion": "",
-  "version": 1663551081946
+  "version": 1663558728608
 }
 }

+ 30 - 0
src/api/shelf.js

@@ -171,4 +171,34 @@ export const delShelfPlaceSn = (params) => {
     data: params,
     data: params,
     method: 'post'
     method: 'post'
   })
   })
+}
+
+// 货架订单-分页列表
+export const orderBillQueryPage = (params) => {
+  const url = `/orderBill/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 货架订单明细-合计
+export const orderBillDetailCount = (params) => {
+  return axios({
+    url: `/orderBill/queryDetailCount`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 货架订单-合计
+export const orderBillQueryCount = (params) => {
+  return axios({
+    url: `/orderBill/queryCount`,
+    data: params,
+    method: 'post'
+  })
 }
 }

+ 36 - 0
src/config/router.config.js

@@ -434,6 +434,42 @@ export const asyncRouterMap = [
               }
               }
             ]
             ]
           },
           },
+          {
+            path: '/numsGoodsShelves/shelfOrder',
+            redirect: '/numsGoodsShelves/shelfOrder/list',
+            name: 'shelfOrder',
+            component: BlankLayout,
+            meta: {
+              title: '货架订单',
+              icon: 'monitor',
+              // permission: 'M_shelfOrder'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shelfOrderList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/shelfOrder/list.vue'),
+                meta: {
+                  title: '货架订单列表',
+                  icon: 'monitor',
+                  hidden: true
+                  // permission: 'M_shelfOrderList'
+                }
+              },
+              {
+                path: 'shelfOrderDetail/:sn',
+                name: 'shelfOrderDetail',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/shelfOrder/detail.vue'),
+                meta: {
+                  title: '货架订单详情',
+                  icon: 'monitor',
+                  hidden: true,
+                  // permission: 'M_shelfOrderDetail'
+                }
+              }
+            ]
+          },
           {
           {
             path: '/numsGoodsShelves/replenishmentManagement',
             path: '/numsGoodsShelves/replenishmentManagement',
             redirect: '/numsGoodsShelves/replenishmentManagement/list',
             redirect: '/numsGoodsShelves/replenishmentManagement/list',

+ 7 - 1
src/views/common/shelfList.js

@@ -3,6 +3,8 @@ const shelfSList = {
   template: `
   template: `
       <a-select
       <a-select
         placeholder="请选择货架"
         placeholder="请选择货架"
+        :maxTagCount="2"
+        :mode="mode"
         :id="id"
         :id="id"
         allowClear
         allowClear
         :value="defaultVal"
         :value="defaultVal"
@@ -16,12 +18,16 @@ const shelfSList = {
     `,
     `,
   props: {
   props: {
     value: {
     value: {
-      type: String,
+      type: [String,Array],
       defatut: ''
       defatut: ''
     },
     },
     id: {
     id: {
       type: String,
       type: String,
       default: ''
       default: ''
+    },
+    mode: {
+      type: String,
+      defatut: 'default'
     }
     }
   },
   },
   data () {
   data () {

+ 4 - 2
src/views/numsGoodsShelves/replenishmentManagement/creatReplenishmentOrder.vue

@@ -10,8 +10,8 @@
     :width="800">
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <div style="padding:0 0 20px;text-align: center;">
       <div style="padding:0 0 20px;text-align: center;">
-        <h4>请选择需要生成补货单的数字货架</h4>
-        <div style="color:#999;font-size:14px;">(请从左侧选择货架并移动到右侧区域)</div>
+        <h3>请选择需要生成补货单的数字货架</h3>
+        <div style="color:#999;font-size:12px;">(请从左侧选择货架并移动到右侧区域)</div>
       </div>
       </div>
       <!-- 列表 -->
       <!-- 列表 -->
       <div>
       <div>
@@ -109,6 +109,8 @@ export default {
     isShow (newValue, oldValue) {
     isShow (newValue, oldValue) {
       if (!newValue) {
       if (!newValue) {
         this.$emit('close')
         this.$emit('close')
+        this.targetKeys = []
+        this.shelfList = []
       } else {
       } else {
         const _this = this
         const _this = this
         this.$nextTick(() => { // 页面渲染完成后的回调
         this.$nextTick(() => { // 页面渲染完成后的回调

+ 1 - 0
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -378,6 +378,7 @@ export default {
     },
     },
     // 重置数据
     // 重置数据
     resetData () {
     resetData () {
+      this.openCreatRoModal = false
       this.$refs.rangeDate.resetDate(this.time)
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime

+ 141 - 0
src/views/numsGoodsShelves/shelfOrder/detail.vue

@@ -0,0 +1,141 @@
+<template>
+  <div v-if="showPage" class="shelfOrderDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="shelfOrderDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }">
+        <template slot="subTitle" v-if="!outBizSn">
+          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="shelfOrderDetail-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="订单编号">{{ detailData&&detailData.orderBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="货架名称">{{ detailData&&detailData.shelfName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="下单时间">{{ detailData&&detailData.orderDate || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="下单人员">{{ detailData&&detailData.orderPersonName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="订单状态"> {{ detailData&&detailData.billStateDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="VIN">{{ detailData&&detailData.vin || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="车型">{{ detailData&&detailData.vehicleModel || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- alert -->
+        <a-alert type="info" style="margin-bottom: 10px;">
+          <div style="display: flex;align-items: center;justify-content: space-between;" slot="message">
+            <div>
+              总款数:<strong>{{ countDetail&&(countDetail.productCategory || countDetail.productCategory==0) ? countDetail.productCategory : '--' }}</strong>;
+              总数量:<strong>{{ countDetail&&(countDetail.totalQty || countDetail.totalQty==0) ? countDetail.totalQty : '--' }}</strong>;
+              总结算金额:<strong>{{ countDetail&&(countDetail.settleAmount || countDetail.settleAmount==0) ? countDetail.settleAmount : '--' }}</strong>;
+            </div>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data-source="detailList"
+          :pagination="false"
+          bordered>
+        </a-table>
+      </a-card>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { orderBillQueryPage, orderBillDetailCount } from '@/api/shelf'
+export default {
+  name: 'SalesDetail',
+  components: { STable, VSelect },
+  mixins: [commonMixin],
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      showPage: false,
+      spinning: false,
+      disabled: false,
+      detailList: [],
+      detailData: null, //  详情数据
+      countDetail: null
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '40%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算价', dataIndex: 'settlePrice', 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 : '--') } },
+        { title: '结算金额小计', dataIndex: 'settleAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'shelfOrderList' })
+    },
+    getDetail () {
+      this.spinning = true
+      orderBillQueryPage({ pageNo: 1, pageSize: 1, orderBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
+        this.spinning = false
+        this.detailData = res.data.list && res.data.list[0]
+        this.detailList = this.detailData.orderBillDetailApiEntityList
+      })
+
+      orderBillDetailCount({ orderBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
+        this.countDetail = res.data || null
+      })
+    },
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.spinning = false
+        vm.disabled = false
+        vm.getDetail()
+      })
+    }
+  },
+  mounted () {
+    this.showPage = true
+    if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.showPage = true
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .shelfOrderDetail-wrap{
+    .shelfOrderDetail-cont{
+      margin-bottom: 10px;
+    }
+  }
+</style>

+ 184 - 0
src/views/numsGoodsShelves/shelfOrder/list.vue

@@ -0,0 +1,184 @@
+<template>
+  <a-card size="small" :bordered="false" class="shelfOrder-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="订单编号">
+                <a-input id="shelfOrder-orderBillNo" v-model.trim="queryParam.orderBillNo" allowClear placeholder="请输入订单编号" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="货架名称">
+                <shelfSList mode="multiple" v-model="queryParam.shelfSnList"></shelfSList>
+              </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-item label="订单状态">
+                <v-select
+                  v-model="queryParam.billState"
+                  ref="billState"
+                  id="shelfOrder-billState"
+                  code="FLAG"
+                  placeholder="请选择"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfOrder-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfOrder-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 提示 -->
+      <a-alert type="info" style="margin-bottom: 10px" v-if="countData">
+        <div slot="message">总款数:{{ countData.productCategory }};总数量:{{ countData.totalQty }};总结算金额:{{ countData.settleAmount }};</div>
+      </a-alert>
+      <!-- 列表 -->
+      <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="orderBillNo" slot-scope="text, record">
+          <span class="table-td-link" @click="handleDetail(record)">{{ record.orderBillNo }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">设置</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import shelfSList from '@/views/common/shelfList'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { orderBillQueryPage, orderBillQueryCount } from '@/api/shelf'
+export default {
+  components: { STable, VSelect, shelfSList, rangeDate },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      time: [],
+      queryParam: {
+        orderStartDate: '',
+        orderEndDate: '',
+        shelfSnList: undefined,
+        orderBillNo: '',
+        billState: undefined
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '订单编号', scopedSlots: { customRender: 'orderBillNo' }, width: '15%', align: 'center' },
+        { title: '货架名称', dataIndex: 'shelfName', width: '34%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总款数', dataIndex: 'productCategory', align: 'center', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总结算金额', dataIndex: 'settleAmount', align: 'center', width: '8%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '下单时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '订单状态', dataIndex: 'billStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        this.orderBillQueryCount(Object.assign(parameter, this.queryParam))
+        return orderBillQueryPage(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
+        })
+      },
+      openModal: false,
+      countData: null
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.orderStartDate = date[0] || null
+      this.queryParam.orderEndDate = date[1] || null
+    },
+    handleDetail (data) {
+      this.$router.push({ name: 'shelfOrderDetail', params: { sn: data.orderBillSn } })
+    },
+    orderBillQueryCount (params) {
+      orderBillQueryCount(params).then(res => {
+        this.countData = res.data || null
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.time = []
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.orderStartDate = ''
+      this.queryParam.orderEndDate = ''
+      this.queryParam.orderBillNo = ''
+      this.queryParam.billState = undefined
+      this.queryParam.shelfSnList = undefined
+      this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>