|
@@ -4,27 +4,18 @@
|
|
|
class="shelfSet-basicInfo-modal"
|
|
|
:footer="null"
|
|
|
:maskClosable="false"
|
|
|
- :title="recallBillInfo.shelfName"
|
|
|
+ :title="'新增回调单——'+recallBillInfo.shelfName"
|
|
|
v-model="isShow"
|
|
|
- @cancel="isShow = false"
|
|
|
+ @cancel="isShow = false;$refs.recallBillTable.clearSelected();showChecked=false"
|
|
|
width="60%">
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
- <a-form-model
|
|
|
- id="shelfSet-basicInfo-form"
|
|
|
- ref="ruleForm"
|
|
|
- :model="queryParam"
|
|
|
- :label-col="formItemLayout.labelCol"
|
|
|
- :wrapper-col="formItemLayout.wrapperCol">
|
|
|
+ <a-form-model id="shelfSet-basicInfo-form" ref="ruleForm" :model="queryParam" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-row :gutter="10">
|
|
|
<a-col :md="8" :sm="24">
|
|
|
- <a-form-model-item label="产品编码">
|
|
|
- <a-input allowClear placeholder="请输入产品编码" v-model.tirm="queryParam.productCode"/>
|
|
|
- </a-form-model-item>
|
|
|
+ <a-form-model-item label="产品编码"><a-input allowClear placeholder="请输入产品编码" v-model.tirm="queryParam.productCode" /></a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="8" :sm="24">
|
|
|
- <a-form-item label="产品名称">
|
|
|
- <a-input allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.productName"/>
|
|
|
- </a-form-item>
|
|
|
+ <a-form-item label="产品名称"><a-input allowClear placeholder="请输入产品名称" v-model.tirm="queryParam.productName" /></a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="8" :sm="24">
|
|
|
<a-form-model-item label="滞销天数">
|
|
@@ -38,7 +29,8 @@
|
|
|
:min="0"
|
|
|
:max="999999"
|
|
|
placeholder="起始天数"
|
|
|
- style="width: 100%;display: inline-block;" />
|
|
|
+ style="width: 100%;display: inline-block;"
|
|
|
+ />
|
|
|
</a-col>
|
|
|
<a-col :md="2" :sm="24"><span style="display: block;text-align: center;line-height: 32px;">至</span></a-col>
|
|
|
<a-col :md="11" :sm="24">
|
|
@@ -49,48 +41,49 @@
|
|
|
:min="0"
|
|
|
:max="999999"
|
|
|
placeholder="截止天数"
|
|
|
- style="width: 100%;display: inline-block;" />
|
|
|
+ style="width: 100%;display: inline-block;"
|
|
|
+ />
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-input-group>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24" style="text-align: right;padding-right: 30px;">
|
|
|
- <a-button type="primary" @click="handleSearch" id="outboundOrderList-refresh" >查询</a-button>
|
|
|
+ <a-button type="primary" @click="$refs.recallBillTable.refresh(true)" id="outboundOrderList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" id="outboundOrderList-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form-model>
|
|
|
<div class="tableCon">
|
|
|
<div style="margin-bottom: 16px">
|
|
|
- <a-button type="primary" :disabled="!hasSelected" @click="handleSave">
|
|
|
- 新增调回单
|
|
|
- </a-button>
|
|
|
+ <a-button type="primary" @click="handleSave">新增调回单</a-button>
|
|
|
<span class="tableSpan">
|
|
|
- <template v-if="hasSelected">
|
|
|
- 已选<span>{{ selectedRowKeys.length }}</span>款产品,共<span>{{ dataList.length }}</span>件
|
|
|
+ <template>
|
|
|
+ 已选
|
|
|
+ <span>{{ selectedRowKeys.length }}</span>
|
|
|
+ 款产品,共
|
|
|
+ <span>{{ totalNum }}</span>
|
|
|
+ 件
|
|
|
</template>
|
|
|
</span>
|
|
|
- <span>
|
|
|
- <a-checkbox @change="isShowChooseList" size="small">
|
|
|
- 仅显示已选产品
|
|
|
- </a-checkbox>
|
|
|
- </span>
|
|
|
+ <span><a-checkbox @change="isShowChooseList" :checked="showChecked" size="small">仅显示已选产品</a-checkbox></span>
|
|
|
</div>
|
|
|
- <a-table
|
|
|
+ <s-table
|
|
|
class="sTable"
|
|
|
ref="recallBillTable"
|
|
|
size="small"
|
|
|
- :rowKey="record => record.id"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.confirmQty == 0 } })}"
|
|
|
+ @rowSelection="onSelectChange"
|
|
|
:columns="columns"
|
|
|
- :dataSource="dataList"
|
|
|
- :scroll="{ y: 200 }"
|
|
|
- :pagination="false"
|
|
|
- bordered
|
|
|
- :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
|
|
|
- <!-- 调回数量 -->
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: 450 }"
|
|
|
+ :showPagination="false"
|
|
|
+ bordered>
|
|
|
<template slot="confirmQty" slot-scope="text, record">
|
|
|
+ <div v-if="record.confirmQty == 0">--</div>
|
|
|
<a-input-number
|
|
|
+ v-else
|
|
|
size="small"
|
|
|
id="shelfMonitoring-add-confirmQty"
|
|
|
v-model="record.confirmQty"
|
|
@@ -98,22 +91,24 @@
|
|
|
:min="0"
|
|
|
:max="record.qty"
|
|
|
placeholder="请输入"
|
|
|
- :style="{ width: '100%', color: record.confirmQty == 0 ? 'red' : '' }"
|
|
|
+ :style="{ width: '100%' }"
|
|
|
/>
|
|
|
</template>
|
|
|
- </a-table>
|
|
|
+ </s-table>
|
|
|
</div>
|
|
|
</a-spin>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { STable } from '@/components'
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { shelfControlList } from '@/api/shelf'
|
|
|
import { shelfRecallSave } from '@/api/shelfRecall'
|
|
|
export default {
|
|
|
name: 'AddRecallBillModal',
|
|
|
mixins: [commonMixin],
|
|
|
+ components: { STable },
|
|
|
props: {
|
|
|
openModal: {
|
|
|
// 弹框显示状态
|
|
@@ -135,67 +130,140 @@ export default {
|
|
|
labelCol: { span: 5 },
|
|
|
wrapperCol: { span: 17 }
|
|
|
},
|
|
|
- queryParam: { // 查询条件
|
|
|
+ queryParam: {
|
|
|
+ // 查询条件
|
|
|
shelfSn: '',
|
|
|
productCode: undefined,
|
|
|
productName: undefined,
|
|
|
unsalableDaysBegin: undefined,
|
|
|
unsalableDaysEnd: undefined
|
|
|
},
|
|
|
+ totalNum: 0,
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
|
|
|
{ title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '最大库容', dataIndex: 'maxQty', width: '15%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
- { title: '补货在途', dataIndex: 'replenishBillQty', width: '15%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
- { title: '调回在途', dataIndex: 'recallBillQty', width: '15%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
- { title: '货架库存', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
- { title: '单位', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '滞销天数', dataIndex: 'unsalableDays', width: '15%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ {
|
|
|
+ title: '产品编码',
|
|
|
+ dataIndex: 'productCode',
|
|
|
+ width: '20%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '产品名称',
|
|
|
+ dataIndex: 'productName',
|
|
|
+ width: '30%',
|
|
|
+ align: 'left',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || '--'
|
|
|
+ },
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '最大库容',
|
|
|
+ dataIndex: 'maxQty',
|
|
|
+ width: '15%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '补货在途',
|
|
|
+ dataIndex: 'replenishBillQty',
|
|
|
+ width: '15%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '调回在途',
|
|
|
+ dataIndex: 'recallBillQty',
|
|
|
+ width: '15%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '货架库存',
|
|
|
+ dataIndex: 'qty',
|
|
|
+ width: '15%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '单位',
|
|
|
+ dataIndex: 'productUnit',
|
|
|
+ width: '15%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '滞销天数',
|
|
|
+ dataIndex: 'unsalableDays',
|
|
|
+ width: '15%',
|
|
|
+ align: 'center',
|
|
|
+ customRender: function (text) {
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
+ }
|
|
|
+ },
|
|
|
{ title: '调回数量', width: '20%', align: 'left', scopedSlots: { customRender: 'confirmQty' } }
|
|
|
],
|
|
|
selectedRowKeys: [], // 选中表格id
|
|
|
- hasSelected: false, // 控制选择按钮
|
|
|
- dataList: [],
|
|
|
- chooseList: []
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getLoadData (ajaxData) { // 获取列表
|
|
|
- this.spinning = true
|
|
|
- if (!this.checkValueRange()) {
|
|
|
- this.spinning = false
|
|
|
- return
|
|
|
- }
|
|
|
- shelfControlList(ajaxData).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- for (var i = 0; i < res.data.length; i++) {
|
|
|
- res.data[i].no = i + 1
|
|
|
- res.data[i].confirmQty = res.data[i].qty
|
|
|
- }
|
|
|
- this.dataList = res.data
|
|
|
- this.spinning = false
|
|
|
- } else {
|
|
|
+ chooseList: [],
|
|
|
+ showChecked: false,
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ // 获取列表
|
|
|
+ this.spinning = true
|
|
|
+ if (!this.checkValueRange()) {
|
|
|
this.spinning = false
|
|
|
+ return
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- onSelectChange (selectedRowKeys, selectedRows) { // 获取选中列表
|
|
|
- if (selectedRowKeys.length > 0) {
|
|
|
- this.hasSelected = true
|
|
|
- } else {
|
|
|
- this.hasSelected = false
|
|
|
+ this.queryParam.shelfSn = this.recallBillInfo.shelfSn
|
|
|
+ return shelfControlList(this.queryParam).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ if (this.showChecked) {
|
|
|
+ data = this.chooseList && this.chooseList || []
|
|
|
+ }
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ data[i].no = i + 1
|
|
|
+ data[i].confirmQty = data[i].qty
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
}
|
|
|
- this.selectedRowKeys = selectedRowKeys
|
|
|
- this.chooseList = selectedRows
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onSelectChange (obj) {
|
|
|
+ // 获取选中列表
|
|
|
+ this.selectedRowKeys = obj.selectedRowKeys
|
|
|
+ this.chooseList = obj.selectedRows || null
|
|
|
+ this.totalNum = obj.selectedRows.reduce((pre, val) => {
|
|
|
+ return pre + val.confirmQty
|
|
|
+ }, 0)
|
|
|
},
|
|
|
// 确定新增回调单
|
|
|
handleSave () {
|
|
|
const _this = this
|
|
|
- _this.spinning = true
|
|
|
+ if (this.chooseList && this.chooseList.length == 0) {
|
|
|
+ this.$message.warning('请先选择产品')
|
|
|
+ return
|
|
|
+ }
|
|
|
const arr = []
|
|
|
- const arrInd = []
|
|
|
this.chooseList.forEach((item, index) => {
|
|
|
if (item.confirmQty) {
|
|
|
arr.push({
|
|
@@ -207,14 +275,9 @@ export default {
|
|
|
productName: item.productName,
|
|
|
qty: item.confirmQty
|
|
|
})
|
|
|
- } else {
|
|
|
- arrInd.push(index + 1)
|
|
|
}
|
|
|
})
|
|
|
- if (arrInd.length > 0) {
|
|
|
- this.$message.warning('调回数量不能为空或0,请移除后提交')
|
|
|
- return
|
|
|
- }
|
|
|
+ _this.spinning = true
|
|
|
const params = {
|
|
|
shelfSn: this.recallBillInfo.shelfSn,
|
|
|
detailList: arr
|
|
@@ -224,27 +287,19 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
_this.$emit('ok')
|
|
|
_this.isShow = false
|
|
|
- _this.hasSelected = false
|
|
|
- _this.selectedRowKeys = [] // 清空选中内容
|
|
|
+ this.$refs.recallBillTable.clearSelected()
|
|
|
_this.$message.success('保存并确认成功')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
isShowChooseList (e) {
|
|
|
- if (e.target.checked) {
|
|
|
- this.dataList = this.chooseList
|
|
|
- } else {
|
|
|
- this.getLoadData(this.queryParam)
|
|
|
- }
|
|
|
- },
|
|
|
- // 查询
|
|
|
- handleSearch () {
|
|
|
- const ajaxData = this.queryParam
|
|
|
- this.getLoadData(ajaxData)
|
|
|
+ this.showChecked = e.target.checked
|
|
|
+ this.$refs.recallBillTable.refresh(true)
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- const obj = { // 查询条件
|
|
|
+ const obj = {
|
|
|
+ // 查询条件
|
|
|
shelfSn: this.recallBillInfo.shelfSn,
|
|
|
productCode: undefined,
|
|
|
productName: undefined,
|
|
@@ -252,7 +307,9 @@ export default {
|
|
|
unsalableDaysEnd: undefined
|
|
|
}
|
|
|
this.queryParam = obj
|
|
|
- this.getLoadData(obj)
|
|
|
+ this.showChecked = false
|
|
|
+ this.$refs.recallBillTable.clearSelected()
|
|
|
+ this.$refs.recallBillTable.refresh(true)
|
|
|
},
|
|
|
// 校验滞销天数数值范围
|
|
|
checkValueRange () {
|
|
@@ -292,13 +349,6 @@ export default {
|
|
|
if (!newValue) {
|
|
|
this.$emit('close')
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
- // this.$refs.custList.resetForm()
|
|
|
- } else {
|
|
|
- if (this.recallBillInfo && this.recallBillInfo.shelfSn) {
|
|
|
- this.queryParam.shelfSn = this.recallBillInfo.shelfSn
|
|
|
- const ajaxData = { shelfSn: this.recallBillInfo.shelfSn }
|
|
|
- this.getLoadData(ajaxData)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -307,21 +357,21 @@ export default {
|
|
|
|
|
|
<style lang="less">
|
|
|
.shelfSet-basicInfo-modal {
|
|
|
- .ant-modal-body {
|
|
|
- padding: 40px 40px 24px;
|
|
|
- }
|
|
|
- .ant-form-item{
|
|
|
+ .ant-modal-body {
|
|
|
+ padding: 40px 40px 24px;
|
|
|
+ }
|
|
|
+ .ant-form-item {
|
|
|
margin-bottom: 15px;
|
|
|
}
|
|
|
- .btn-cont {
|
|
|
- text-align: center;
|
|
|
- margin: 35px 0 10px;
|
|
|
- }
|
|
|
- .tableSpan{
|
|
|
- margin:0 16px;
|
|
|
- span{
|
|
|
+ .btn-cont {
|
|
|
+ text-align: center;
|
|
|
+ margin: 35px 0 10px;
|
|
|
+ }
|
|
|
+ .tableSpan {
|
|
|
+ margin: 0 16px;
|
|
|
+ span {
|
|
|
margin: 0 10px;
|
|
|
- color:red;
|
|
|
+ color: red;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
}
|