|
@@ -45,13 +45,22 @@
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
+ <div v-if="$hasPermissions('B_outboundBatchOut')" style="margin-bottom: 10px">
|
|
|
+ <a-button type="primary" id="outboundOrderList-export" :loading="loading" @click="handleOutbounds">批量出库</a-button>
|
|
|
+ <span style="margin-left: 5px" v-if="$hasPermissions('B_outboundBatchOut')">
|
|
|
+ <template v-if="hasSelected">
|
|
|
+ {{ `已选 ${selectedRowKeys.length} 项` }}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable fixPagination"
|
|
|
ref="table"
|
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
+ :row-selection="$hasPermissions('B_outboundBatchOut') ? rowSelection : null"
|
|
|
+ :rowKey="(record) => record.outBizSn"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
:scroll="{ y: tableHeight }"
|
|
@@ -102,6 +111,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import moment from 'moment'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import pushOrderDetailModal from '@/views/purchasingManagement/purchaseReturn/detail.vue'
|
|
@@ -110,7 +120,7 @@ import urgentDetailModal from '@/views/salesManagement/urgentItemsOffset/detail.
|
|
|
import storeTransferOutDetailModal from '@/views/allocationManagement/storeTransferOut/detail.vue'
|
|
|
import chainTransferOutDetailModal from '@/views/allocationManagement/chainTransferOut/detail.vue'
|
|
|
import warehouseAllocationDetailModal from '@/views/allocationManagement/warehouseAllocation/detail.vue'
|
|
|
-import { stockOutList, stockOutOut } from '@/api/stockOut'
|
|
|
+import { stockOutList, stockOutOut, stockOutBatchOut } from '@/api/stockOut'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
export default {
|
|
|
components: { STable, VSelect, rangeDate, pushOrderDetailModal, salesDetailModal, urgentDetailModal, storeTransferOutDetailModal, chainTransferOutDetailModal, warehouseAllocationDetailModal },
|
|
@@ -120,8 +130,8 @@ export default {
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
tableHeight: 0, // 表格高度
|
|
|
time: [
|
|
|
- getDate.getCurrMonthDays().starttime,
|
|
|
- getDate.getCurrMonthDays().endtime
|
|
|
+ moment(getDate.getCurrMonthDays().starttime),
|
|
|
+ moment(getDate.getCurrMonthDays().endtime)
|
|
|
],
|
|
|
queryParam: { // 查询条件
|
|
|
beginDate: getDate.getCurrMonthDays().starttime,
|
|
@@ -145,6 +155,7 @@ export default {
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
],
|
|
|
selectedRowKeys: [], // Check here to configure the default column
|
|
|
+ selectedRows: [],
|
|
|
loading: false,
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -175,16 +186,26 @@ export default {
|
|
|
return this.selectedRowKeys.length > 0
|
|
|
},
|
|
|
rowSelection () {
|
|
|
- return {
|
|
|
- selectedRowKeys: this.selectedRowKeys,
|
|
|
- onChange: (selectedRowKeys, selectedRows) => {
|
|
|
- this.onSelectChange(selectedRowKeys)
|
|
|
- },
|
|
|
- getCheckboxProps: record => ({
|
|
|
- props: {
|
|
|
- disabled: record.state == 'FINISH' // Column configuration not to be checked
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.$hasPermissions('B_outboundBatchOut')) {
|
|
|
+ return {
|
|
|
+ selectedRowKeys: this.selectedRowKeys,
|
|
|
+ onChange: (selectedRowKeys, selectedRows) => {
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
+ },
|
|
|
+ onSelect: (record, selected, selectedRows, nativeEvent) => {
|
|
|
+ this.onSelectChange(record, selected, selectedRows, nativeEvent)
|
|
|
+ },
|
|
|
+ onSelectAll: (selected, selectedRows, changeRows) => {
|
|
|
+ this.onSelectAllChange(selected, selectedRows, changeRows)
|
|
|
+ },
|
|
|
+ getCheckboxProps: record => ({
|
|
|
+ props: {
|
|
|
+ disabled: record.state == 'FINISH'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return null
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -278,7 +299,7 @@ export default {
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- stockOutOut(Object.assign(row, { outStockEnum: row.outBizType })).then(res => {
|
|
|
+ stockOutOut({ outBizSn: row.outBizSn, outStockEnum: row.outBizType }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$refs.table.refresh()
|
|
@@ -297,14 +318,49 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|
|
|
- // ajax request after empty completing
|
|
|
- setTimeout(() => {
|
|
|
+ this.spinning = true
|
|
|
+ const params = []
|
|
|
+ this.selectedRows.map(item => {
|
|
|
+ params.push({ outBizSn: item.outBizSn, outStockEnum: item.outBizType })
|
|
|
+ })
|
|
|
+ stockOutBatchOut(params).then(res => {
|
|
|
this.loading = false
|
|
|
- this.selectedRowKeys = []
|
|
|
- }, 1000)
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ this.spinning = false
|
|
|
+ } else {
|
|
|
+ this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- onSelectChange (selectedRowKeys) {
|
|
|
- this.selectedRowKeys = selectedRowKeys
|
|
|
+ onSelectChange (record, selected, selectedRows, nativeEvent) {
|
|
|
+ console.log(record, selected, selectedRows, nativeEvent)
|
|
|
+ if (selected) { // 选择
|
|
|
+ this.selectedRows.push(record)
|
|
|
+ } else { // 取消
|
|
|
+ this.selectedRows = selectedRows
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 本页全选/取消全选
|
|
|
+ onSelectAllChange (selected, selectedRows, changeRows) {
|
|
|
+ const _this = this
|
|
|
+ if (selected) { // 选择
|
|
|
+ this.selectedRows = [...this.selectedRows, ...changeRows]
|
|
|
+ } else { // 取消
|
|
|
+ const arrId = []
|
|
|
+ this.selectedRows.map((item, index) => {
|
|
|
+ this.selectedRows.map((subItem, ind) => {
|
|
|
+ if (item.outBizSn == subItem.outBizSn) {
|
|
|
+ arrId.push(index)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ arrId.map((item, index) => {
|
|
|
+ _this.selectedRows = _this.selectedRows.slice(item, item + 1)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
pageInit () {
|
|
|
const _this = this
|