|
@@ -35,7 +35,7 @@
|
|
</div>
|
|
</div>
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
- <div slot="message">入库数量 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,入库金额 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong></div>
|
|
|
|
|
|
+ <div slot="message">入库数量 <strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,入库金额 <strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
|
|
</a-alert>
|
|
</a-alert>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
@@ -71,39 +71,21 @@
|
|
size="large"
|
|
size="large"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
@click="handleSubmit"
|
|
@click="handleSubmit"
|
|
- style="padding: 0 60px;">提交</a-button>
|
|
|
|
|
|
+ style="padding: 0 60px;">保存并返回</a-button>
|
|
</div>
|
|
</div>
|
|
</a-affix>
|
|
</a-affix>
|
|
- <!-- 选择基本信息弹框 -->
|
|
|
|
- <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
|
|
|
+ <spare-parts-product-modal :openModal="openModal" :itemSn="itemSn" @ok="handleOk" @close="openModal=false" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import basicInfoModal from './basicInfoModal.vue'
|
|
|
|
-import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
|
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
|
-// import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
|
-// import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount, sparePartsPurDetailSave, sparePartsPurDetailDel, sparePartsPurSubmit } from '@/api/sparePartsPur'
|
|
|
|
-// import { dealerProductList } from '@/api/dealerProduct'
|
|
|
|
-import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
|
|
|
+import sparePartsProductModal from './productModal.vue'
|
|
|
|
+import { sparePartsDetailList, sparePartsPageCount } from '@/api/spareParts'
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect, basicInfoModal },
|
|
|
|
|
|
+ components: { STable, VSelect, sparePartsProductModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- queryParam: {
|
|
|
|
- queryWord: '',
|
|
|
|
- productBrandSn: undefined,
|
|
|
|
- productTypeSn1: undefined,
|
|
|
|
- productTypeSn2: undefined,
|
|
|
|
- productTypeSn3: undefined
|
|
|
|
- },
|
|
|
|
- productBrandList: [], // 产品品牌 下拉数据
|
|
|
|
- productTypeList: [], // 产品分类 下拉数据
|
|
|
|
- productType: [],
|
|
|
|
- warehouseCascadeData: [], // 仓库仓位
|
|
|
|
- disabled: false, // 查询、重置按钮是否可操作
|
|
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
@@ -115,93 +97,25 @@ export default {
|
|
{ title: '小计', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '小计', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
- loadData: [],
|
|
|
|
- pageNo: 1, // 分页页码
|
|
|
|
- pageSize: 10, // 分页 每页多少条
|
|
|
|
- paginationProps: {
|
|
|
|
- showSizeChanger: true, // 是否可以改变 pageSize
|
|
|
|
- total: 0, // 分页总条数
|
|
|
|
- current: 1,
|
|
|
|
- onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
|
|
|
|
- onChange: (current) => this.changePage(current)
|
|
|
|
- },
|
|
|
|
- // 表头
|
|
|
|
- chooseColumns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', sorter: true },
|
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品品牌', dataIndex: 'brandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '成本价', scopedSlots: { customRender: 'putCost' }, width: 140, align: 'center' },
|
|
|
|
- { title: '数量', scopedSlots: { customRender: 'putQty' }, width: 140, align: 'center' },
|
|
|
|
- { title: '成本小计', dataIndex: 'costSubtotal', width: 100, align: 'center' },
|
|
|
|
- { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
|
- ],
|
|
|
|
- chooseLoadData: [],
|
|
|
|
- choosePageNo: 1, // 分页页码
|
|
|
|
- choosePageSize: 10, // 分页 每页多少条
|
|
|
|
- choosePaginationProps: {
|
|
|
|
- showSizeChanger: true, // 是否可以改变 pageSize
|
|
|
|
- total: 0, // 分页总条数
|
|
|
|
- current: 1,
|
|
|
|
- onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
|
|
|
|
- onChange: (current) => this.changeChoosePage(current)
|
|
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ loadData: parameter => {
|
|
|
|
+ return sparePartsDetailList(Object.assign(parameter, { sn: this.$route.params.sn })).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
|
|
|
|
+ }
|
|
|
|
+ this.getDetailCount(Object.assign(parameter, { sn: this.$route.params.sn }))
|
|
|
|
+ return data
|
|
|
|
+ })
|
|
},
|
|
},
|
|
openModal: false, // 选择基本信息弹框是否显示
|
|
openModal: false, // 选择基本信息弹框是否显示
|
|
- warehouseList: [], // 仓库 下拉数据
|
|
|
|
- warehouseLocList: {}, // 仓位 下拉数据
|
|
|
|
- defaultWarehouseCascade: [], // 默认仓库仓位
|
|
|
|
- chooseWarehouseList: [], // 已选产品 仓库 下拉数据
|
|
|
|
- chooseWarehouseLocList: {}, // 已选产品 仓位 下拉数据
|
|
|
|
basicInfoData: null, // 基本信息
|
|
basicInfoData: null, // 基本信息
|
|
- productTotal: null // 合计
|
|
|
|
|
|
+ productTotal: null, // 合计
|
|
|
|
+ itemSn: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 重置
|
|
|
|
- resetSearchForm () {
|
|
|
|
- this.queryParam.queryWord = ''
|
|
|
|
- this.queryParam.productBrandSn = undefined
|
|
|
|
- this.queryParam.productTypeSn1 = ''
|
|
|
|
- this.queryParam.productTypeSn2 = ''
|
|
|
|
- this.queryParam.productTypeSn3 = ''
|
|
|
|
- this.productType = []
|
|
|
|
- this.getDealerProductList(1)
|
|
|
|
- },
|
|
|
|
- // 双击快速添加
|
|
|
|
- handleClickRow (record) {
|
|
|
|
- return {
|
|
|
|
- on: {
|
|
|
|
- dblclick: (event) => {
|
|
|
|
- this.handleAdd(record)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 分页 一页多少条change
|
|
|
|
- changePageSize (current, pageSize) {
|
|
|
|
- this.pageNo = current
|
|
|
|
- this.pageSize = pageSize
|
|
|
|
- this.getDealerProductList()
|
|
|
|
- },
|
|
|
|
- // 分页 页码change
|
|
|
|
- changePage (current) {
|
|
|
|
- this.pageNo = current
|
|
|
|
- this.getDealerProductList()
|
|
|
|
- },
|
|
|
|
- // 已选产品 分页 一页多少条change
|
|
|
|
- changeChoosePageSize (current, pageSize) {
|
|
|
|
- this.choosePageNo = current
|
|
|
|
- this.choosePageSize = pageSize
|
|
|
|
- this.getChooseDealerProductList()
|
|
|
|
- },
|
|
|
|
- // 已选产品 分页 页码change
|
|
|
|
- changeChoosePage (current) {
|
|
|
|
- this.choosePageNo = current
|
|
|
|
- this.getChooseDealerProductList()
|
|
|
|
- },
|
|
|
|
// 基本信息
|
|
// 基本信息
|
|
getDetail () {
|
|
getDetail () {
|
|
sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
|
|
sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
|
|
@@ -212,58 +126,11 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 添加/编辑
|
|
|
|
- handleAdd (row, isEdit) {
|
|
|
|
- if (!isEdit && !row.putCost) {
|
|
|
|
- this.$message.warning('请输入成本价后再添加!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!isEdit && !row.putQty) {
|
|
|
|
- this.$message.warning('请输入数量后再添加!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!isEdit && !row.warehouseSn) {
|
|
|
|
- this.$message.warning('请选择仓库后再添加!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!isEdit && !row.warehouseLocationSn) {
|
|
|
|
- this.$message.warning('请选择仓位后再添加!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- const params = {
|
|
|
|
- id: isEdit ? row.id : undefined,
|
|
|
|
- sparePartsPurchaseSn: this.$route.params.sn,
|
|
|
|
- putCost: row.putCost,
|
|
|
|
- putQty: row.putQty,
|
|
|
|
- productCode: isEdit ? row.productCode : row.code,
|
|
|
|
- productOrigCode: (isEdit ? row.productOrigCode : row.origCode) || undefined,
|
|
|
|
- productSn: row.productSn,
|
|
|
|
- productTypeSn1: row.productTypeSn1,
|
|
|
|
- productTypeSn2: row.productTypeSn2,
|
|
|
|
- productTypeSn3: row.productTypeSn3,
|
|
|
|
- brandSn: isEdit ? row.brandSn : row.productBrandSn,
|
|
|
|
- warehouseLocationSn: row.warehouseLocationSn,
|
|
|
|
- warehouseSn: row.warehouseSn
|
|
|
|
- }
|
|
|
|
- if (isEdit) { // 编辑
|
|
|
|
- // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
|
|
|
|
- if (!row.putCost) {
|
|
|
|
- row.putCost = row.putCostBackups
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!row.putQty) {
|
|
|
|
- row.putQty = row.putQtyBackups
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- sparePartsPurDetailSave(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.$message.success(res.message)
|
|
|
|
- this.getChooseDealerProductList()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // 添加
|
|
|
|
+ handleAdd () {
|
|
|
|
+ this.openModal = true
|
|
},
|
|
},
|
|
- // 提交
|
|
|
|
|
|
+ // 保存
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
const _this = this
|
|
const _this = this
|
|
sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
|
|
sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
|
|
@@ -286,7 +153,7 @@ export default {
|
|
sparePartsPurDetailDel({ id: row.id }).then(res => {
|
|
sparePartsPurDetailDel({ id: row.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
- _this.getChooseDealerProductList()
|
|
|
|
|
|
+ _this.$refs.table.refresh()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -298,17 +165,13 @@ export default {
|
|
},
|
|
},
|
|
// 基本信息 保存
|
|
// 基本信息 保存
|
|
handleOk () {},
|
|
handleOk () {},
|
|
- // 导入明细
|
|
|
|
- handleImport () {
|
|
|
|
- console.log(333)
|
|
|
|
- },
|
|
|
|
// 返回列表
|
|
// 返回列表
|
|
handleBack () {
|
|
handleBack () {
|
|
- this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
|
|
|
|
|
|
+ this.$router.push({ path: '/purchasingManagement/bulkWarehousingOrder/list' })
|
|
},
|
|
},
|
|
// 合计
|
|
// 合计
|
|
getDetailCount (params) {
|
|
getDetailCount (params) {
|
|
- sparePartsPurDetailCount(params).then(res => {
|
|
|
|
|
|
+ sparePartsPageCount(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.productTotal = res.data
|
|
this.productTotal = res.data
|
|
} else {
|
|
} else {
|
|
@@ -316,211 +179,36 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- changeWarehouseCascade (val, opt, ind, type) {
|
|
|
|
- let loadData
|
|
|
|
- if (type == 'dealerProduct') { // 全部产品
|
|
|
|
- loadData = this.loadData[ind]
|
|
|
|
- } else if (type == 'sparePartsPurDetail') { // 已选产品
|
|
|
|
- loadData = this.chooseLoadData[ind]
|
|
|
|
- }
|
|
|
|
- if (val.length < 2) {
|
|
|
|
- this.$message.warning('当前仓库无仓位,请选择其他仓库')
|
|
|
|
- const warehouseSnBackups = loadData.warehouseSnBackups || undefined
|
|
|
|
- const warehouseLocationSnBackups = loadData.warehouseLocationSnBackups || undefined
|
|
|
|
- loadData.warehouseSn = warehouseSnBackups
|
|
|
|
- loadData.warehouseLocationSn = warehouseLocationSnBackups
|
|
|
|
- if (warehouseSnBackups || warehouseLocationSnBackups) {
|
|
|
|
- loadData.warehouseCascade = [warehouseSnBackups, warehouseLocationSnBackups]
|
|
|
|
- } else {
|
|
|
|
- loadData.warehouseCascade = undefined
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- loadData.warehouseSn = val[0] ? val[0] : ''
|
|
|
|
- loadData.warehouseLocationSn = val[1] ? val[1] : ''
|
|
|
|
- if (type == 'sparePartsPurDetail') { // 已选产品
|
|
|
|
- loadData = this.chooseLoadData[ind]
|
|
|
|
- this.handleAdd(loadData, 'edit')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 已选产品 成本价 blur
|
|
|
|
- putCostBlur (val, record) {
|
|
|
|
- // 光标移出,值发生改变再调用编辑接口
|
|
|
|
- if (val != record.putCostBackups) {
|
|
|
|
- this.handleAdd(record, 'edit')
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 已选产品 数量 blur
|
|
|
|
- putQtyBlur (val, record) {
|
|
|
|
- if (val != record.putQtyBackups) {
|
|
|
|
- this.handleAdd(record, 'edit')
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 产品分类 change
|
|
|
|
- changeProductType (val, opt) {
|
|
|
|
- this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
- this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
- this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
|
- },
|
|
|
|
// 产品列表数据
|
|
// 产品列表数据
|
|
- getDealerProductList (pageNo, sorter) {
|
|
|
|
- this.disabled = true
|
|
|
|
|
|
+ getProductList (pageNo, sorter) {
|
|
this.pageNo = pageNo || this.pageNo
|
|
this.pageNo = pageNo || this.pageNo
|
|
- const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
|
|
|
|
- params.enabledFlag = 1
|
|
|
|
- params.sysFlag = 0
|
|
|
|
- if (sorter) {
|
|
|
|
- params.sortField = sorter.field
|
|
|
|
- params.sortOrder = sorter.order
|
|
|
|
- params.sortAlias = 'dp'
|
|
|
|
|
|
+ const params = {
|
|
|
|
+ pageNo: this.pageNo,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ sn: this.$route.params.sn
|
|
}
|
|
}
|
|
- dealerProductList(params).then(res => {
|
|
|
|
|
|
+ sparePartsDetailList(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
|
|
+ this.getDetailCount(params)
|
|
const data = res.data
|
|
const data = res.data
|
|
this.paginationProps.total = Number(res.data.count) || 0
|
|
this.paginationProps.total = Number(res.data.count) || 0
|
|
this.paginationProps.current = this.pageNo
|
|
this.paginationProps.current = this.pageNo
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
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.loadData = data.list
|
|
- this.disabled = false
|
|
|
|
} else {
|
|
} else {
|
|
this.paginationProps.total = 0
|
|
this.paginationProps.total = 0
|
|
this.paginationProps.current = 1
|
|
this.paginationProps.current = 1
|
|
this.loadData = []
|
|
this.loadData = []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- },
|
|
|
|
- // 已选产品列表数据
|
|
|
|
- getChooseDealerProductList (pageNo, sorter) {
|
|
|
|
- this.choosePageNo = pageNo || this.choosePageNo
|
|
|
|
- const params = {
|
|
|
|
- pageNo: this.choosePageNo,
|
|
|
|
- pageSize: this.choosePageSize,
|
|
|
|
- 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'
|
|
|
|
- }
|
|
|
|
- sparePartsPurDetailList(params).then(res => {
|
|
|
|
- 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.chooseLoadData = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 仓库仓位 级联 列表
|
|
|
|
- getWarehouseCascade () {
|
|
|
|
- const _this = this
|
|
|
|
- warehouseCascadeList({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- res.data.filter(item => {
|
|
|
|
- // 过滤默认仓库
|
|
|
|
- if (item.defaultFlag == 1 && item.wasteFlag == 0) { // defaultFlag为1,且不是废品仓
|
|
|
|
- _this.defaultWarehouseCascade[0] = item.id
|
|
|
|
- // 过滤默认仓位
|
|
|
|
- item.warehouseLocationList.filter(subItem => {
|
|
|
|
- if (subItem.defaultFlag == 1 && subItem.wasteFlag == 0) {
|
|
|
|
- _this.defaultWarehouseCascade[1] = subItem.id
|
|
|
|
- _this.getDealerProductList(1)
|
|
|
|
- _this.getChooseDealerProductList(1)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- res.data.map(item => {
|
|
|
|
- item.sn = item.warehouseSn
|
|
|
|
- if (item.warehouseLocationList) {
|
|
|
|
- item.warehouseLocationList.map(subItem => {
|
|
|
|
- subItem.sn = subItem.warehouseLocationSn
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- this.warehouseCascadeData = res.data
|
|
|
|
- } else {
|
|
|
|
- this.warehouseCascadeData = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 产品品牌 列表
|
|
|
|
- getProductBrand () {
|
|
|
|
- // sysFlag传0,表示只查自建产品
|
|
|
|
- dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productBrandList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productBrandList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 产品分类 列表
|
|
|
|
- getProductType () {
|
|
|
|
- dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productTypeList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productTypeList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- filterOption (input, option) {
|
|
|
|
- return (
|
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
- )
|
|
|
|
- },
|
|
|
|
- // 选择产品 表格 change
|
|
|
|
- onTableChange (pagination, filters, sorter) {
|
|
|
|
- console.log('-------------------------------')
|
|
|
|
- console.log('params', pagination, filters, sorter)
|
|
|
|
- this.getDealerProductList(this.pageNo, sorter)
|
|
|
|
- },
|
|
|
|
- // 已选产品 表格 change
|
|
|
|
- onChooseTableChange (pagination, filters, sorter) {
|
|
|
|
- console.log('++++++++++++++++++++++++++++++++++')
|
|
|
|
- this.getChooseDealerProductList(this.choosePageNo, sorter)
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.openModal = false
|
|
vm.openModal = false
|
|
- vm.getWarehouseCascade()
|
|
|
|
- vm.getDetail()
|
|
|
|
- vm.getProductBrand()
|
|
|
|
- vm.getProductType()
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|