|
@@ -14,8 +14,8 @@
|
|
|
<a-radio value="NEEDLE">针式</a-radio>
|
|
|
<a-radio value="INK">喷墨</a-radio>
|
|
|
</a-radio-group>
|
|
|
- <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
- <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
|
+ <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn" :disabled="chooseLoadDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
+ <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn" :disabled="chooseLoadDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 基础信息 -->
|
|
@@ -81,25 +81,23 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="getDealerProductList(1)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="bulkWarehousingOrderEdit-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
- <a-table
|
|
|
+ <s-table
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:customRow="handleClickRow"
|
|
|
- :dataSource="loadData"
|
|
|
- :loading="loading"
|
|
|
+ :data="loadData"
|
|
|
+ :defaultLoadData="false"
|
|
|
:scroll="{ x: 1600, y: 300 }"
|
|
|
- :pagination="false"
|
|
|
- @change="onTableChange"
|
|
|
bordered>
|
|
|
<!-- 成本价 -->
|
|
|
<template slot="putCost" slot-scope="text, record">
|
|
@@ -143,15 +141,7 @@
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
|
|
|
</template>
|
|
|
- </a-table>
|
|
|
- <!-- 分页 -->
|
|
|
- <tablePagination
|
|
|
- ref="tablePagination"
|
|
|
- :total="paginationProps.total"
|
|
|
- :current="paginationProps.current"
|
|
|
- :pageSize="paginationProps.pageSize"
|
|
|
- @changePageSize="changePageSize"
|
|
|
- @changePage="changePage" />
|
|
|
+ </s-table>
|
|
|
</div>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
@@ -175,17 +165,14 @@
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
- <a-table
|
|
|
+ <s-table
|
|
|
class="sTable"
|
|
|
ref="chooseTable"
|
|
|
size="small"
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="chooseColumns"
|
|
|
- :dataSource="chooseLoadData"
|
|
|
+ :data="chooseLoadData"
|
|
|
:scroll="{ x: 1700, y: 300 }"
|
|
|
- :loading="chooseLoading"
|
|
|
- :pagination="false"
|
|
|
- @change="onChooseTableChange"
|
|
|
bordered>
|
|
|
<!-- 成本价 -->
|
|
|
<template slot="putCost" slot-scope="text, record">
|
|
@@ -231,31 +218,21 @@
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkWarehousingOrderEdit-del-btn">删除</a-button>
|
|
|
</template>
|
|
|
- </a-table>
|
|
|
- <!-- 分页 -->
|
|
|
- <tablePagination
|
|
|
- ref="chooseTablePagination"
|
|
|
- :total="choosePaginationProps.total"
|
|
|
- :current="choosePaginationProps.current"
|
|
|
- :pageSize="choosePaginationProps.pageSize"
|
|
|
- @changePageSize="changeChoosePageSize"
|
|
|
- @changePage="changeChoosePage" />
|
|
|
+ </s-table>
|
|
|
</div>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
|
</a-card>
|
|
|
- <a-affix :offset-bottom="0">
|
|
|
- <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
|
- <a-button
|
|
|
- type="primary"
|
|
|
- id="bulkWarehousingOrderEdit-submit"
|
|
|
- size="large"
|
|
|
- class="button-primary"
|
|
|
- @click="handleSubmit"
|
|
|
- style="padding: 0 60px;">提交</a-button>
|
|
|
- </div>
|
|
|
- </a-affix>
|
|
|
</a-spin>
|
|
|
+ <div class="affix-cont">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ id="bulkWarehousingOrderEdit-submit"
|
|
|
+ size="large"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleSubmit"
|
|
|
+ style="padding: 0 60px;">提交</a-button>
|
|
|
+ </div>
|
|
|
<!-- 选择基本信息弹框 -->
|
|
|
<basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
<!-- 打印 -->
|
|
@@ -265,7 +242,6 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import tablePagination from '@/views/common/tablePagination.vue'
|
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
|
import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
@@ -274,7 +250,7 @@ import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount,
|
|
|
import { dealerProductList } from '@/api/dealerProduct'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
export default {
|
|
|
- components: { STable, VSelect, basicInfoModal, tablePagination },
|
|
|
+ components: { STable, VSelect, basicInfoModal },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
@@ -305,11 +281,29 @@ export default {
|
|
|
{ title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
- loadData: [],
|
|
|
- paginationProps: {
|
|
|
- total: 0, // 分页总条数
|
|
|
- current: 1,
|
|
|
- pageSize: 20
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ parameter.sortAlias = 'dp'
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
+ params.enabledFlag = 1
|
|
|
+ return dealerProductList(params).then(res => {
|
|
|
+ const 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
|
|
|
+ if (this.defaultWarehouseCascade.length > 0) {
|
|
|
+ data.list[i].warehouseCascade = this.defaultWarehouseCascade
|
|
|
+ data.list[i].warehouseSn = this.defaultWarehouseCascade[0]
|
|
|
+ data.list[i].warehouseLocationSn = this.defaultWarehouseCascade[1]
|
|
|
+ } else {
|
|
|
+ data.list[i].warehouseCascade = undefined
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.loadDataSource = data.list
|
|
|
+ this.disabled = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
},
|
|
|
// 表头
|
|
|
chooseColumns: [
|
|
@@ -325,12 +319,44 @@ export default {
|
|
|
{ title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
- chooseLoadData: [],
|
|
|
- choosePaginationProps: {
|
|
|
- total: 0, // 分页总条数
|
|
|
- current: 1,
|
|
|
- pageSize: 20
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ chooseLoadData: parameter => {
|
|
|
+ // 排序
|
|
|
+ if (parameter.sortField == 'brandName') {
|
|
|
+ parameter.sortField = 'productBrandName'
|
|
|
+ parameter.sortAlias = 'dp'
|
|
|
+ }
|
|
|
+ if (parameter.sortField == 'productName') {
|
|
|
+ parameter.sortField = 'productCode'
|
|
|
+ parameter.sortAlias = 'sppd'
|
|
|
+ }
|
|
|
+ const params = Object.assign(parameter, { sparePartsPurchaseSn: this.$route.params.sn })
|
|
|
+ return sparePartsPurDetailList(params).then(res => {
|
|
|
+ this.getDetailCount(params)
|
|
|
+ const 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
|
|
|
+ data.list[i].putCostBackups = data.list[i].putCost
|
|
|
+ data.list[i].putQtyBackups = data.list[i].putQty
|
|
|
+ const warehouseSn = data.list[i].warehouseSn || undefined
|
|
|
+ const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
|
|
|
+ if (warehouseSn || warehouseLocationSn) {
|
|
|
+ data.list[i].warehouseSnBackups = warehouseSn
|
|
|
+ data.list[i].warehouseLocationSnBackups = warehouseLocationSn
|
|
|
+ data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
|
|
|
+ } else {
|
|
|
+ data.list[i].warehouseCascade = undefined
|
|
|
+ }
|
|
|
+ // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
+ data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
|
|
|
+ }
|
|
|
+ this.chooseLoadDataSource = data.list
|
|
|
+ return data
|
|
|
+ })
|
|
|
},
|
|
|
+ loadDataSource: [],
|
|
|
+ chooseLoadDataSource: [],
|
|
|
openModal: false, // 选择基本信息弹框是否显示
|
|
|
warehouseList: [], // 仓库 下拉数据
|
|
|
warehouseLocList: {}, // 仓位 下拉数据
|
|
@@ -351,10 +377,7 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = ''
|
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
this.productType = []
|
|
|
- this.paginationProps.total = 0
|
|
|
- this.paginationProps.current = 1
|
|
|
- this.paginationProps.pageSize = 20
|
|
|
- this.getDealerProductList(1)
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 打印预览/快捷打印
|
|
|
handlePrint (type) {
|
|
@@ -400,28 +423,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // 分页 一页多少条change
|
|
|
- changePageSize (current, pageSize) {
|
|
|
- this.paginationProps.current = current
|
|
|
- this.paginationProps.pageSize = pageSize
|
|
|
- this.getDealerProductList()
|
|
|
- },
|
|
|
- // 分页 页码change
|
|
|
- changePage (current) {
|
|
|
- this.paginationProps.current = current
|
|
|
- this.getDealerProductList()
|
|
|
- },
|
|
|
- // 已选产品 分页 一页多少条change
|
|
|
- changeChoosePageSize (current, pageSize) {
|
|
|
- this.choosePaginationProps.current = current
|
|
|
- this.choosePaginationProps.pageSize = pageSize
|
|
|
- this.getChooseDealerProductList()
|
|
|
- },
|
|
|
- // 已选产品 分页 页码change
|
|
|
- changeChoosePage (current) {
|
|
|
- this.choosePaginationProps.current = current
|
|
|
- this.getChooseDealerProductList()
|
|
|
- },
|
|
|
// 基本信息
|
|
|
getDetail () {
|
|
|
sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
|
|
@@ -480,7 +481,7 @@ export default {
|
|
|
sparePartsPurDetailSave(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.success(res.message)
|
|
|
- this.getChooseDealerProductList()
|
|
|
+ this.$refs.chooseTable.refresh()
|
|
|
this.spinning = false
|
|
|
} else {
|
|
|
this.spinning = false
|
|
@@ -515,7 +516,7 @@ export default {
|
|
|
sparePartsPurDetailDel({ id: row.id }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- _this.getChooseDealerProductList()
|
|
|
+ _this.$refs.chooseTable.refresh()
|
|
|
_this.spinning = false
|
|
|
} else {
|
|
|
_this.spinning = false
|
|
@@ -551,9 +552,9 @@ export default {
|
|
|
changeWarehouseCascade (val, opt, ind, type) {
|
|
|
let loadData
|
|
|
if (type == 'dealerProduct') { // 全部产品
|
|
|
- loadData = this.loadData[ind]
|
|
|
+ loadData = this.loadDataSource[ind]
|
|
|
} else if (type == 'sparePartsPurDetail') { // 已选产品
|
|
|
- loadData = this.chooseLoadData[ind]
|
|
|
+ loadData = this.chooseLoadDataSource[ind]
|
|
|
}
|
|
|
if (val.length < 2) {
|
|
|
this.$message.warning('当前仓库无仓位,请选择其他仓库')
|
|
@@ -570,7 +571,7 @@ export default {
|
|
|
loadData.warehouseSn = val[0] ? val[0] : ''
|
|
|
loadData.warehouseLocationSn = val[1] ? val[1] : ''
|
|
|
if (type == 'sparePartsPurDetail') { // 已选产品
|
|
|
- loadData = this.chooseLoadData[ind]
|
|
|
+ loadData = this.chooseLoadDataSource[ind]
|
|
|
this.handleAdd(loadData, 'edit')
|
|
|
}
|
|
|
}
|
|
@@ -594,93 +595,6 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
- // 产品列表数据
|
|
|
- getDealerProductList (pageNo, sorter) {
|
|
|
- this.disabled = true
|
|
|
- this.loading = true
|
|
|
- this.paginationProps.current = pageNo || this.paginationProps.current
|
|
|
- const params = Object.assign({ pageNo: this.paginationProps.current, pageSize: this.paginationProps.pageSize }, this.queryParam)
|
|
|
- params.enabledFlag = 1
|
|
|
- // params.sysFlag = 0
|
|
|
- if (sorter) {
|
|
|
- params.sortField = sorter.field
|
|
|
- params.sortOrder = sorter.order
|
|
|
- params.sortAlias = 'dp'
|
|
|
- }
|
|
|
- dealerProductList(params).then(res => {
|
|
|
- this.loading = false
|
|
|
- if (res.status == 200) {
|
|
|
- const data = res.data
|
|
|
- this.paginationProps.total = Number(res.data.count) || 0
|
|
|
- this.paginationProps.current = data.pageNo
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = no + i + 1
|
|
|
- if (this.defaultWarehouseCascade.length > 0) {
|
|
|
- data.list[i].warehouseCascade = this.defaultWarehouseCascade
|
|
|
- data.list[i].warehouseSn = this.defaultWarehouseCascade[0]
|
|
|
- data.list[i].warehouseLocationSn = this.defaultWarehouseCascade[1]
|
|
|
- } else {
|
|
|
- data.list[i].warehouseCascade = undefined
|
|
|
- }
|
|
|
- }
|
|
|
- this.loadData = data.list
|
|
|
- this.disabled = false
|
|
|
- } else {
|
|
|
- this.paginationProps.total = 0
|
|
|
- this.paginationProps.current = 1
|
|
|
- this.paginationProps.pageSize = 20
|
|
|
- this.loadData = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 已选产品列表数据
|
|
|
- getChooseDealerProductList (pageNo, sorter) {
|
|
|
- this.choosePaginationProps.current = pageNo || this.choosePaginationProps.current
|
|
|
- const params = {
|
|
|
- pageNo: this.choosePaginationProps.current,
|
|
|
- pageSize: this.choosePaginationProps.pageSize,
|
|
|
- sparePartsPurchaseSn: this.$route.params.sn
|
|
|
- }
|
|
|
- if (sorter) {
|
|
|
- params.sortField = sorter.field == 'brandName' ? 'productBrandName' : 'productCode'
|
|
|
- params.sortOrder = sorter.order
|
|
|
- params.sortAlias = sorter.field == 'brandName' ? 'dp' : 'sppd'
|
|
|
- }
|
|
|
- this.chooseLoading = true
|
|
|
- sparePartsPurDetailList(params).then(res => {
|
|
|
- this.chooseLoading = false
|
|
|
- if (res.status == 200) {
|
|
|
- this.getDetailCount(params)
|
|
|
- const data = res.data
|
|
|
- this.choosePaginationProps.total = Number(res.data.count) || 0
|
|
|
- this.choosePaginationProps.current = data.pageNo
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = no + i + 1
|
|
|
- data.list[i].putCostBackups = data.list[i].putCost
|
|
|
- data.list[i].putQtyBackups = data.list[i].putQty
|
|
|
- const warehouseSn = data.list[i].warehouseSn || undefined
|
|
|
- const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
|
|
|
- if (warehouseSn || warehouseLocationSn) {
|
|
|
- data.list[i].warehouseSnBackups = warehouseSn
|
|
|
- data.list[i].warehouseLocationSnBackups = warehouseLocationSn
|
|
|
- data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
|
|
|
- } else {
|
|
|
- data.list[i].warehouseCascade = undefined
|
|
|
- }
|
|
|
- // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
- data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
|
|
|
- }
|
|
|
- this.chooseLoadData = data.list
|
|
|
- } else {
|
|
|
- this.choosePaginationProps.total = 0
|
|
|
- this.choosePaginationProps.current = 1
|
|
|
- this.choosePaginationProps.pageSize = 20
|
|
|
- this.chooseLoadData = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 仓库仓位 级联 列表
|
|
|
getWarehouseCascade () {
|
|
|
const _this = this
|
|
@@ -694,8 +608,8 @@ export default {
|
|
|
item.warehouseLocationList.filter(subItem => {
|
|
|
if (subItem.defaultFlag == 1 && subItem.wasteFlag == 0) {
|
|
|
_this.defaultWarehouseCascade[1] = subItem.warehouseLocationSn
|
|
|
- _this.getDealerProductList(1)
|
|
|
- _this.getChooseDealerProductList(1)
|
|
|
+ _this.$refs.table.refresh(true)
|
|
|
+ _this.$refs.chooseTable.refresh(true)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -739,20 +653,11 @@ export default {
|
|
|
return (
|
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
)
|
|
|
- },
|
|
|
- // 选择产品 表格 change
|
|
|
- onTableChange (pagination, filters, sorter) {
|
|
|
- this.getDealerProductList(this.paginationProps.current, sorter)
|
|
|
- },
|
|
|
- // 已选产品 表格 change
|
|
|
- onChooseTableChange (pagination, filters, sorter) {
|
|
|
- this.getChooseDealerProductList(this.choosePaginationProps.current, sorter)
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
vm.openModal = false
|
|
|
- vm.getChooseDealerProductList(1)
|
|
|
vm.getWarehouseCascade()
|
|
|
vm.getDetail()
|
|
|
vm.getProductBrand()
|
|
@@ -764,6 +669,14 @@ export default {
|
|
|
|
|
|
<style lang="less">
|
|
|
.bulkWarehousingOrderEdit-wrap{
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ padding-bottom: 51px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ >.ant-spin-nested-loading{
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
.bulkWarehousingOrderEdit-cont{
|
|
|
margin-bottom: 10px;
|
|
|
.sub-title{
|
|
@@ -771,19 +684,6 @@ export default {
|
|
|
color: #808695;
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
- .tag-txt{
|
|
|
- font-size: 12px;
|
|
|
- color: #ed1c24;
|
|
|
- }
|
|
|
- .edit-circle-btn{
|
|
|
- margin-left: 15px;
|
|
|
- i{
|
|
|
- vertical-align: text-bottom;
|
|
|
- }
|
|
|
- }
|
|
|
- .import-btn{
|
|
|
- margin-left: 15px;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</style>
|