|
@@ -9,145 +9,162 @@
|
|
:rules="rules"
|
|
:rules="rules"
|
|
:labelCol="labelCol"
|
|
:labelCol="labelCol"
|
|
:wrapperCol="wrapperCol"
|
|
:wrapperCol="wrapperCol"
|
|
- @keyup.enter.native="$refs.table.refresh(true)" >
|
|
|
|
|
|
+ @keyup.enter.native="getStockList(1)" >
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-model-item label="客户名称" prop="customer">
|
|
|
|
- <a-select
|
|
|
|
- placeholder="请选择客户"
|
|
|
|
- allowClear
|
|
|
|
- v-model="queryParam.customer"
|
|
|
|
- :showSearch="true"
|
|
|
|
- option-filter-prop="children"
|
|
|
|
- :filter-option="filterOption"
|
|
|
|
- >
|
|
|
|
- <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
|
|
+ <a-form-model-item label="客户名称" prop="customer.customerSn">
|
|
|
|
+ <custSatelliteList ref="custSatelliteList" @change="custSatelliteChange"></custSatelliteList>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-model-item label="配件名称">
|
|
<a-form-model-item label="配件名称">
|
|
- <a-input id="satelliteWarehouseInventoryList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入配件名称" />
|
|
|
|
|
|
+ <a-input id="satelliteWarehouseInventoryList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入配件名称" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-model-item label="配件编码">
|
|
<a-form-model-item label="配件编码">
|
|
- <a-input id="satelliteWarehouseInventoryList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码或产品原厂编码" />
|
|
|
|
|
|
+ <a-input id="satelliteWarehouseInventoryList-queryWord" v-model.trim="queryParam.dealerProduct.queryWord" allowClear placeholder="请输入产品编码或产品原厂编码" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="satelliteWarehouseInventoryList-refresh" style="margin-top: 4px">
|
|
|
|
- 查询
|
|
|
|
- </a-button>
|
|
|
|
- <a-button @click="resetSearchForm" :disabled="disabled" id="satelliteWarehouseInventoryList-reset" style="margin: 4px 0 0 8px">重置</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="satelliteWarehouseInventoryList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="satelliteWarehouseInventoryList-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</div>
|
|
</div>
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
- <a-button id="satelliteWarehouseInventoryList-replenishment" type="primary" @click="handleReplenishment">
|
|
|
|
- 补货清单
|
|
|
|
- <span v-if="checkedList.length>0">({{ checkedList.length }})</span>
|
|
|
|
- </a-button>
|
|
|
|
|
|
+ <a-button id="satelliteWarehouseInventoryList-replenishment" type="primary" @click="handleReplenishment">补货清单</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <s-table
|
|
|
|
|
|
+ <a-table
|
|
class="sTable"
|
|
class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
size="default"
|
|
size="default"
|
|
- :rowKey="record => record.id"
|
|
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
- :data="loadData"
|
|
|
|
- :scroll="{ x: 1010 }"
|
|
|
|
|
|
+ :data-source="loadData"
|
|
|
|
+ :pagination="paginationProps"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :scroll="{ x: 1210, y: tableHeight }"
|
|
bordered>
|
|
bordered>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="link" v-if="checkedList.indexOf(record.id) != -1" @click="handleRemove(record)" id="satelliteWarehouseInventoryList-remove-btn">移出补货清单</a-button>
|
|
|
|
- <a-button size="small" type="link" v-else @click="handleAdd(record)" id="satelliteWarehouseInventoryList-add-btn">加入补货单</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="link" @click="handleAdd(record)" id="satelliteWarehouseInventoryList-add-btn">加入补货单</a-button>
|
|
</template>
|
|
</template>
|
|
- </s-table>
|
|
|
|
- <!-- 客户详情 -->
|
|
|
|
- <satellite-warehouse-inventory-add-modal :openModal="openModal" @close="closeModal" />
|
|
|
|
|
|
+ </a-table>
|
|
|
|
+ <!-- 补货单 -->
|
|
|
|
+ <satellite-warehouse-inventory-add-modal :openModal="openModal" :nowData="nowData" @close="closeModal" />
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import satelliteWarehouseInventoryAddModal from './addModal.vue'
|
|
import satelliteWarehouseInventoryAddModal from './addModal.vue'
|
|
-import { custAllList } from '@/api/customer'
|
|
|
|
|
|
+import custSatelliteList from '@/views/common/custSatelliteList.vue'
|
|
|
|
+import { satelliteWHStockList, satelliteWHSupplyInsert } from '@/api/satelliteWH'
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect, satelliteWarehouseInventoryAddModal },
|
|
|
|
|
|
+ components: { STable, VSelect, satelliteWarehouseInventoryAddModal, custSatelliteList },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
labelCol: { span: 8 },
|
|
labelCol: { span: 8 },
|
|
wrapperCol: { span: 16 },
|
|
wrapperCol: { span: 16 },
|
|
|
|
+ tableHeight: 0,
|
|
queryParam: {
|
|
queryParam: {
|
|
- // 查询条件
|
|
|
|
- customer: undefined, // 客户名称
|
|
|
|
- bundleName: '', // 套餐名称
|
|
|
|
- itemName: '', // 服务名称
|
|
|
|
- brand: undefined // 产品品牌
|
|
|
|
|
|
+ customer: {
|
|
|
|
+ customerSn: undefined
|
|
|
|
+ },
|
|
|
|
+ dealerProduct: {
|
|
|
|
+ name: '',
|
|
|
|
+ queryWord: ''
|
|
|
|
+ }
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- customer: [{ required: true, message: '请输入客户名称', trigger: 'blur' }]
|
|
|
|
|
|
+ 'customer.customerSn': [{ required: true, message: '请选择客户名称', trigger: ['blur', 'change'] }]
|
|
},
|
|
},
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
- custAllList: [], // 客户 下拉数据
|
|
|
|
|
|
+ loading: false, // 表格加载中
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
- { title: '客户名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '配件名称', dataIndex: 'productBrand', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '当前库存', dataIndex: 'inventoryNumss', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '客户名称', dataIndex: 'customer.customerName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '配件名称', dataIndex: 'dealerProduct.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProduct.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'dealerProduct.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '当前库存', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
|
- loadData: parameter => {
|
|
|
|
- this.disabled = true
|
|
|
|
- // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).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.disabled = false
|
|
|
|
- // return data
|
|
|
|
- // })
|
|
|
|
- const _this = this
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
- const data = {
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- list: [
|
|
|
|
- { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
|
|
|
|
- { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
|
|
|
|
- { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- data.list[i].no = no + i + 1
|
|
|
|
- }
|
|
|
|
- _this.disabled = false
|
|
|
|
- resolve(data)
|
|
|
|
- })
|
|
|
|
|
|
+ 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)
|
|
},
|
|
},
|
|
- openModal: false, // 查看客户详情 弹框
|
|
|
|
- checkedList: [] // 加入补货单数据
|
|
|
|
|
|
+ openModal: false,
|
|
|
|
+ nowData: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 不可选日期
|
|
|
|
- disabledDate (date, dateStrings) {
|
|
|
|
- return date && date.valueOf() > Date.now()
|
|
|
|
|
|
+ custSatelliteChange (val) {
|
|
|
|
+ this.queryParam.customer.customerSn = val.key
|
|
|
|
+ this.nowData = {
|
|
|
|
+ customerName: '',
|
|
|
|
+ customerSn: ''
|
|
|
|
+ }
|
|
|
|
+ this.nowData.customerName = val.label
|
|
|
|
+ this.nowData.customerSn = val.key
|
|
|
|
+ },
|
|
|
|
+ // 列表
|
|
|
|
+ getStockList (pageNo) {
|
|
|
|
+ this.pageNo = pageNo || this.pageNo
|
|
|
|
+ this.disabled = true
|
|
|
|
+ if (this.tableHeight == 0) {
|
|
|
|
+ this.tableHeight = window.innerHeight - 380
|
|
|
|
+ }
|
|
|
|
+ const params = {
|
|
|
|
+ pageNo: this.pageNo,
|
|
|
|
+ pageSize: this.pageSize
|
|
|
|
+ }
|
|
|
|
+ this.loading = true
|
|
|
|
+ satelliteWHStockList(Object.assign(params, this.queryParam)).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
|
|
|
|
+ }
|
|
|
|
+ this.loadData = data.list
|
|
|
|
+ this.disabled = false
|
|
|
|
+ } else {
|
|
|
|
+ this.paginationProps.total = 0
|
|
|
|
+ this.paginationProps.current = 1
|
|
|
|
+ this.loadData = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 分页 一页多少条change
|
|
|
|
+ changePageSize (current, pageSize) {
|
|
|
|
+ this.pageNo = current
|
|
|
|
+ this.pageSize = pageSize
|
|
|
|
+ this.getStockList()
|
|
|
|
+ },
|
|
|
|
+ // 分页 页码change
|
|
|
|
+ changePage (current) {
|
|
|
|
+ this.pageNo = current
|
|
|
|
+ this.getStockList()
|
|
},
|
|
},
|
|
// 查询
|
|
// 查询
|
|
handleSearch () {
|
|
handleSearch () {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ this.getStockList(1)
|
|
} else {
|
|
} else {
|
|
console.log('error submit!!')
|
|
console.log('error submit!!')
|
|
return false
|
|
return false
|
|
@@ -156,48 +173,51 @@ export default {
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.orderBundleNo = ''
|
|
|
|
- this.queryParam.orderBundle.custMobile = ''
|
|
|
|
- this.queryParam.bundleName = ''
|
|
|
|
- this.queryParam.itemName = ''
|
|
|
|
- this.oldTime = undefined
|
|
|
|
- this.newTime = undefined
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ this.queryParam.customer.customerSn = undefined
|
|
|
|
+ this.queryParam.dealerProduct.name = ''
|
|
|
|
+ this.queryParam.dealerProduct.queryWord = ''
|
|
|
|
+ this.$refs.custSatelliteList.resetForm()
|
|
|
|
+ this.nowData = null
|
|
|
|
+ this.paginationProps.total = 0
|
|
|
|
+ this.paginationProps.current = 1
|
|
|
|
+ this.loadData = []
|
|
|
|
+ this.getStockList(1)
|
|
},
|
|
},
|
|
// 补货清单
|
|
// 补货清单
|
|
handleReplenishment () {
|
|
handleReplenishment () {
|
|
- this.openModal = true
|
|
|
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.openModal = true
|
|
|
|
+ } else {
|
|
|
|
+ console.log('error submit!!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 加入补货单
|
|
// 加入补货单
|
|
handleAdd (row) {
|
|
handleAdd (row) {
|
|
- this.checkedList.indexOf(row.id) == -1 ? this.checkedList.push(row.id) : null
|
|
|
|
- },
|
|
|
|
- // 移出补货单
|
|
|
|
- handleRemove (row) {
|
|
|
|
- this.checkedList.splice(this.checkedList.indexOf(row.id), 1)
|
|
|
|
- },
|
|
|
|
- // 关闭弹框
|
|
|
|
- closeModal () {
|
|
|
|
- this.openModal = false
|
|
|
|
- },
|
|
|
|
- // 客户无分页列表数据
|
|
|
|
- getCustAllList () {
|
|
|
|
- const _this = this
|
|
|
|
- custAllList().then(res => {
|
|
|
|
|
|
+ const params = {
|
|
|
|
+ sn: row.customerSn,
|
|
|
|
+ satelliteWarehouseSupply: {
|
|
|
|
+ productSn: row.dealerProduct.productSn,
|
|
|
|
+ productCode: row.dealerProduct.code,
|
|
|
|
+ productQty: 1
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ satelliteWHSupplyInsert(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- _this.custAllList = res.data || []
|
|
|
|
- } else {
|
|
|
|
- _this.custAllList = []
|
|
|
|
|
|
+ this.$message.success('添加成功')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- filterOption (input, option) {
|
|
|
|
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
|
|
+ // 关闭弹框
|
|
|
|
+ closeModal () {
|
|
|
|
+ this.openModal = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
- vm.getCustAllList()
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|