zhangdan 3 years ago
parent
commit
e70e6ca6ab

+ 91 - 0
src/views/numsGoodsShelves/accountManagement/applyWithdrawal.vue

@@ -0,0 +1,91 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    :width="560"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="applyWithdrawal-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="申请提现金额" prop="consigneeName">
+          <a-input
+            id="applyWithdrawal"
+            placeholder="请输入正数(最多两位小数)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="提现手续费">
+          <span>{{}}</span>
+        </a-form-model-item>
+        <a-form-model-item label="实际到账">
+          <span>{{}}(申请提现金额-提现手续费)</span>
+        </a-form-model-item>
+        <a-form-model-item label="提现账户">
+          <span>{{}}</span>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="applyWithdrawal-btn-submit">保存</a-button>
+          <a-button @click="cancel" style="margin-left: 15px" id="applyWithdrawal-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  props: {
+    isOpenModal: {
+      type: Boolean,
+      default: false
+    },
+    currentData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 15 }
+      },
+      opened: this.isOpenModal,
+      title: '申请提现',
+      confirmLoading: false,
+      spinning: false,
+      rules: []
+    }
+  },
+  methods: {
+    // 保存
+    handleSubmit () {
+      this.$emit('close')
+    },
+    // 取消
+    cancel () {
+      this.$emit('close')
+    }
+  },
+  watch: {
+    isOpenModal (nVal, oVal) {
+      this.opened = nVal
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 167 - 1
src/views/numsGoodsShelves/accountManagement/list.vue

@@ -1,8 +1,174 @@
 <template>
+  <a-card size="small" :bordered="false" class="accountManagementList-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 :xl="6" :lg="6" :md="12" :sm="24">
+              <a-form-item label="交易时间">
+                <a-range-picker v-model="time" :format="dateFormat" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD"/>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="6" :md="6" :sm="6" style="padding-top: 4px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="outboundOrderList-refresh" >查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-alert type="info" style="margin:10px 0">
+        <div slot="message" style="display: flex;align-items: center;padding: 2px 0;">
+          <div>
+            账户余额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? totalData.totalAmount : '--' }}</strong>元;
+            可提现金额:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+          </div>
+          <div>
+            <a-button size="small" type="primary" class="button-primary" @click="handleTX">申请提现</a-button>
+          </div>
+        </div>
+      </a-alert>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+77+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:tableHeight }"
+        :defaultLoadData="true"
+        bordered>
+      </s-table>
+    </a-spin>
+    <!-- 申请提现 -->
+    <applyWithdrawal :isOpenModal="showModal" :currentData="currentData" @close="showModal=false" @refresh="$refs.table.refresh(true)"></applyWithdrawal>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import { STable } from '@/components'
+import applyWithdrawal from './applyWithdrawal.vue'
+export default {
+  components: { STable, applyWithdrawal },
+  data () {
+    return {
+      spinning: false,
+      disabled: false,
+      tableHeight: 0,
+      showModal: false,
+      currentData: null,
+      time: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '交易时间', dataIndex: 'createDate', width: '15%', align: 'center' },
+        { title: '调回单号', dataIndex: 'name', width: '30%', align: 'center' },
+        { title: '货架名称', dataIndex: 'remarks', width: '10%', align: 'center' },
+        { title: '状态', dataIndex: 'remarks', width: '10%', align: 'center' },
+        { title: '调回总量', dataIndex: 'remarks', width: '10%', align: 'center' },
+        { title: '操作', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        return new Promise(function (resolve, reject) {
+          const data = {
+            list: [{ id: 1, createDate: '2020-08-09' }]
+          }
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = i + 1
+          }
+          _this.spinning = false
+          _this.disabled = false
+          resolve(data)
+        })
+
+        // const paramsPage = Object.assign(this.queryParam) //  有分页
+        // return reportSalesReturnThjdReportList(paramsPage).then(res => {
+        //   let data
+        //   if (res.status == 200) {
+        //     data = res.data
+        //     // this.getCount(paramsPage)
+        //     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: {
+    // 时间改变
+    dateChange (date) {
+
+    },
+    // 禁止选择今天之后的日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 重置
+    resetSearchForm () {
+      this.time = []
+    },
+    // 申请提现
+    handleTX () {
+      this.showModal = true
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 265
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
+    },
+    '$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()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
 
-<style>
+<style lang="less">
+  .accountManagementList-wrap{
+
+  }
 </style>

+ 123 - 0
src/views/numsGoodsShelves/recallManagement/confirmModal.vue

@@ -0,0 +1,123 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    :width="960"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="margin-bottom: 10px;">调回单号:{{ currentData.createDate||'--' }}</div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:500 }"
+        :showPagination="false"
+        :defaultLoadData="true"
+        bordered>
+        <template slot="action" slot-scope="text, record">
+          <a-input-number id="inputNumber" v-model="value" :min="1" :max="10" @change="onChange" />
+        </template>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+export default {
+  components: { STable },
+  props: {
+    isOpenModal: {
+      type: Boolean,
+      default: false
+    },
+    currentData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 15 }
+      },
+      opened: this.isOpenModal,
+      confirmLoading: false,
+      spinning: false,
+      rules: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'createDate', width: '15%', align: 'center' },
+        { title: '产品名称', dataIndex: 'name', width: '30%', align: 'center' },
+        { title: '调回数量', width: '10%', align: 'center' },
+        { title: '实际退库数量', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } },
+        { title: '单位', width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // this.disabled = true
+        // this.spinning = true
+        return new Promise(function (resolve, reject) {
+          const data = {
+            list: [{ id: 1, createDate: '2020-08-09' }]
+          }
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = i + 1
+          }
+          // this.spinning = false
+          // this.disabled = false
+          resolve(data)
+        })
+        // return employeeList(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: {
+    title () {
+      return '调回单退库' + ' —— ' + (this.currentData && this.currentData.createDate ? this.currentData.createDate : '')
+    }
+  },
+
+  methods: {
+    // 保存
+    handleSubmit () {
+      this.$emit('close')
+    },
+    // 取消
+    cancel () {
+      this.$emit('close')
+    }
+  },
+  watch: {
+    isOpenModal (nVal, oVal) {
+      this.opened = nVal
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 250 - 1
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -1,8 +1,257 @@
 <template>
+  <a-card size="small" :bordered="false" class="accountManagementList-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="36">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <a-range-picker v-model="time" allowClear :disabledDate="disabledDate" format="YYYY-MM-DD" style="width: 100%;"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调拨单号">
+                <a-input allowClear placeholder="请输入调拨单号" v-model.tirm="queryParam.danhao"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="货架名称">
+                <a-select placeholder="请搜索货架名称" allowClear style="width: 100%;">
+                  <a-select-option v-for="item in goodsShelveList">
+                    {{ }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品编码">
+                  <a-input allowClear placeholder="请输入产品编码" v-model.tirm="queryParam.code"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品名称">
+                  <a-input allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.name"/>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="padding-top: 4px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="outboundOrderList-refresh" >查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" v-if="activeKey==0">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-tabs v-model="activeKey" type="card" size="small" @change="callback">
+        <a-tab-pane :key="0" tab="全部">
+        </a-tab-pane>
+        <a-tab-pane :key="1">
+          <span slot="tab">
+            待退库
+            <a-badge count="5" :offset="[0,-20]"/>
+          </span>
+        </a-tab-pane>
+        <a-tab-pane :key="2" tab="已完成">
+        </a-tab-pane>
+        <a-tab-pane :key="3" tab="已取消">
+        </a-tab-pane>
+      </a-tabs>
+      <!-- <a-tabs v-model="activeKey" type="card" @change="callback" size="small">
+        <a-tab-pane :key="item.code" :tab="item.name" v-for="item in tabsList">
+          <span slot="tab">
+            <a-badge count="5" :offset="[0,-20]"/>
+          </span>
+        </a-tab-pane>
+      </a-tabs> -->
+
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+77+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:tableHeight }"
+        :showPagination="false"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-primary"
+            @click="handleEdit(record)"
+            id="shelfMonitoringList-warehousing-btn">退库</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-primary"
+            @click="handleCancel(record)"
+            id="shelfMonitoringList-warehousing-btn">取消调回单</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 申请提现 -->
+    <confirmModal :isOpenModal="showModal" :currentData="currentData" @close="showModal=false" @refresh="$refs.table.refresh(true)"></confirmModal>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import { STable } from '@/components'
+import confirmModal from './confirmModal.vue'
+export default {
+  components: { STable, confirmModal },
+  data () {
+    return {
+      spinning: false,
+      disabled: false,
+      tableHeight: 0,
+      showModal: false,
+      advanced: false,
+      currentData: null,
+      activeKey: 0, // 默认的tab
+      tabsList: [{ code: 0, name: '全部' }, { code: 1, name: '待退库' }, { code: 2, name: '已完成' }, { code: 3, name: '已取消' }],
+      time: [],
+      goodsShelveList: [], // 货架数据
+      queryParam: {
+        danhao: '',
+        name: '',
+        code: ''
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center' },
+        { title: '调回单号', dataIndex: 'name', width: '30%', align: 'center' },
+        { title: '货架名称', dataIndex: 'remarks', width: '10%', align: 'center', scopedSlots: { customRender: 'remarks' } },
+        { title: '状态', width: '10%', align: 'center' },
+        { title: '调回总量', width: '10%', align: 'center' },
+        { title: '实退总量', width: '10%', align: 'center' },
+        { title: '操作', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        // this.disabled = true
+        // this.spinning = true
+        return new Promise(function (resolve, reject) {
+          const data = {
+            list: [{ id: 1, createDate: '2020-08-09' }]
+          }
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = i + 1
+          }
+          // this.spinning = false
+          // this.disabled = false
+          resolve(data)
+        })
+        // return employeeList(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: {
+    // 时间改变
+    dateChange (date) {
+
+    },
+    // 禁止选择今天之后的日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    // 切换tab
+    callback (key) {
+      console.log(key)
+      this.activeKey = key
+    },
+    // 重置
+    resetSearchForm () {
+      this.time = []
+    },
+    // 申请提现
+    handleTX () {
+      this.showModal = true
+    },
+    // 退库
+    handleEdit (row) {
+      this.showModal = true
+      this.currentData = row
+    },
+    // 取消掉回单
+    handleCancel (row) {
+      this.$confirm({
+        title: '提示',
+        content: '确定取消调回单吗?',
+        centered: true,
+        onOk: () => {
+          //
+        }
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 265
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
+    },
+    '$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()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
 
-<style>
+<style lang="less">
+  .accountManagementList-wrap{
+
+  }
 </style>