|
@@ -43,18 +43,9 @@
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
- <a-tabs v-model="activeKey" type="card" size="small" @change="tabChange">
|
|
|
- <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-tabs type="card" v-model="queryParam.billState" @change="tabChange" class="replenishmentManagementList-tabs ">
|
|
|
+ <a-tab-pane v-for="item in tabsList" :key="item.code">
|
|
|
+ <p slot="tab">{{ item.name }}<span v-if="item.countNum&&item.code=='WAIT_CONFIRM'" style="color:red">({{ item.countNum }})</span></p>
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
<s-table
|
|
@@ -86,13 +77,14 @@
|
|
|
id="shelfMonitoringList-warehousing-btn">取消调回单</a-button>
|
|
|
</template>
|
|
|
<a-table
|
|
|
+ v-if="innerData&&innerData[index]"
|
|
|
size="small"
|
|
|
class="inner-table"
|
|
|
- slot-scope="record"
|
|
|
+ slot-scope="record,index"
|
|
|
slot="expandedRowRender"
|
|
|
:rowKey="(rec) => rec.id"
|
|
|
:columns="innerColumns"
|
|
|
- :data-source="record.innerData"
|
|
|
+ :data-source="innerData[index].innerData"
|
|
|
:pagination="false"
|
|
|
>
|
|
|
</a-table>
|
|
@@ -111,7 +103,7 @@ import { STable } from '@/components'
|
|
|
import recallModal from './recallModal.vue'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
import shelfList from '@/views/common/shelfList.vue'
|
|
|
-import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel } from '@/api/shelfRecall.js'
|
|
|
+import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount } from '@/api/shelfRecall.js'
|
|
|
export default {
|
|
|
components: { STable, recallModal, rangeDate, shelfList },
|
|
|
mixins: [commonMixin],
|
|
@@ -124,7 +116,7 @@ export default {
|
|
|
advanced: false,
|
|
|
currentData: null,
|
|
|
activeKey: 0, // 默认的tab
|
|
|
- tabsList: [{ code: 0, name: '全部' }, { code: 1, name: '待退库' }, { code: 2, name: '已完成' }, { code: 3, name: '已取消' }],
|
|
|
+ tabsList: [],
|
|
|
time: [
|
|
|
getDate.getCurrMonthDays().starttime,
|
|
|
getDate.getCurrMonthDays().endtime
|
|
@@ -133,31 +125,37 @@ export default {
|
|
|
beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
|
|
|
endDate: getDate.getCurrMonthDays().endtime, // 结束时间
|
|
|
recallBillNo: '',
|
|
|
- shelfSn: '' // 数字货架sn
|
|
|
+ shelfSn: '', // 数字货架sn
|
|
|
+ billState: 'ALL'
|
|
|
},
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center' },
|
|
|
- { title: '调回单号', dataIndex: 'recallBillNo', width: '20%', align: 'center' },
|
|
|
- { title: '货架名称', dataIndex: 'remarks', width: '25%', align: 'left', scopedSlots: { customRender: 'remarks' } },
|
|
|
- { title: '状态', dataIndex: 'state', width: '7%', align: 'center' },
|
|
|
- { title: '调回总量', dataIndex: 'totalQty', width: '9%', align: 'center' },
|
|
|
- { title: '实退总量', dataIndex: 'totalConfirmQty', width: '9%', align: 'center' },
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '调回单号', dataIndex: 'recallBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '货架名称', dataIndex: 'shelfInfo.shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '状态', dataIndex: 'state', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '调回总量', dataIndex: 'totalQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '实退总量', dataIndex: 'totalConfirmQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', width: '10%', align: 'left', scopedSlots: { customRender: 'action' } }
|
|
|
],
|
|
|
innerColumns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left' },
|
|
|
- { title: '调回数量', dataIndex: 'qty', width: '15%', align: 'center' },
|
|
|
- { title: '实退数量', dataIndex: 'confirmQty', width: '15%', align: 'center' },
|
|
|
- { title: '单位', dataIndex: 'unit', width: '15%', align: 'center' }
|
|
|
+ { title: '产品编码', dataIndex: 'product.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '调回数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '实退数量', dataIndex: 'confirmQty', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单位', dataIndex: 'product.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
+ innerData: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return shelfRecallList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ const params = this.queryParam
|
|
|
+ if (params.billState == 'ALL') {
|
|
|
+ params.billState = ''
|
|
|
+ }
|
|
|
+ return shelfRecallList(Object.assign(parameter, params)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -166,6 +164,7 @@ export default {
|
|
|
data.list[i].no = no + i + 1
|
|
|
data.list[i].innerData = []
|
|
|
}
|
|
|
+ this.innerData = data.list || []
|
|
|
this.disabled = false
|
|
|
}
|
|
|
this.spinning = false
|
|
@@ -176,8 +175,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 选择货架
|
|
|
- shelfChange (data) {
|
|
|
-
|
|
|
+ shelfChange (obj) {
|
|
|
+ this.queryParam.shelfSn = obj.key || undefined
|
|
|
},
|
|
|
// 时间改变
|
|
|
dateChange (date) {
|
|
@@ -195,6 +194,21 @@ export default {
|
|
|
this.queryParam.billState = key
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+ // 获取各类型下的数量
|
|
|
+ getSumByType () {
|
|
|
+ shelfRecallStateCount({}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.tabsList = [
|
|
|
+ { code: 'ALL', name: '全部', countNum: 0 }, { code: 'WAIT_CONFIRM', name: '待退库', countNum: 0 }, { code: 'FINISH', name: '已完成', countNum: 0 }, { code: 'CANCEL', name: '已取消', countNum: 0 }
|
|
|
+ ]
|
|
|
+ this.queryParam.billState = 'ALL'
|
|
|
+ this.tabsList[1].countNum = res.data.WAIT_CONFIRM || 0
|
|
|
+ this.tabsList[2].countNum = res.data.FINISH || 0
|
|
|
+ this.tabsList[3].countNum = res.data.CANCEL || 0
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 点击行或图标触发接口
|
|
|
expand (expanded, record) {
|
|
|
if (expanded) {
|
|
@@ -204,34 +218,33 @@ export default {
|
|
|
// 获取子表格数据
|
|
|
getinnerData (record) {
|
|
|
this.spinning = true
|
|
|
- shelfRecallDetailList({ shelfSn: record.shelfSn }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- record.innerData = res.data.data
|
|
|
- const no = 0
|
|
|
- for (var i = 0; i < this.innerData.length; i++) {
|
|
|
- record.innerData[i].no = no + i + 1
|
|
|
+ shelfRecallDetailList({ recallBillSn: record.recallBillSn }).then(res => {
|
|
|
+ const ind = this.innerData.findIndex(item => item.id == record.id)
|
|
|
+ if (ind >= 0) {
|
|
|
+ if (res.status == 200 && res.data && res.data.length) {
|
|
|
+ res.data.map((item, index) => {
|
|
|
+ item.no = index + 1
|
|
|
+ })
|
|
|
+ this.innerData[ind].innerData = res.data
|
|
|
+ } else {
|
|
|
+ this.innerData[ind].innerData = []
|
|
|
}
|
|
|
- } else {
|
|
|
- record.innerData = []
|
|
|
}
|
|
|
this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.time = [getDate.getCurrMonthDays().starttime, getDate.getCurrMonthDays().endtime]
|
|
|
+ this.$refs.rangeDate.resetDate(this.time)
|
|
|
this.queryParam = {
|
|
|
beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
|
|
|
endDate: getDate.getCurrMonthDays().endtime, // 结束时间
|
|
|
recallBillNo: '', // 调回单号
|
|
|
- shelfSn: '' // 数字货架sn
|
|
|
+ shelfSn: '', // 数字货架sn
|
|
|
+ billState: 'ALL'
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- // 申请提现
|
|
|
- handleTX () {
|
|
|
- this.showModal = true
|
|
|
- },
|
|
|
// 退库
|
|
|
handleRecall (row) {
|
|
|
this.showModal = true
|
|
@@ -267,6 +280,7 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
+ this.getSumByType()
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|