|
@@ -9,8 +9,8 @@
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
|
|
<template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
|
|
- <a-button key="2" id="allocateBillEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
|
- <a-button key="1" type="primary" id="allocateBillEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
|
|
|
|
+ <a-button key="2" id="allocateBillEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
|
+ <a-button key="1" type="primary" id="allocateBillEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<!-- 选择产品 -->
|
|
<!-- 选择产品 -->
|
|
@@ -36,7 +36,7 @@
|
|
<a-input id="allocateBillEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
|
|
<a-input id="allocateBillEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
|
|
|
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -52,7 +52,7 @@
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:customRow="handleClickRow"
|
|
:customRow="handleClickRow"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
- :scroll="{ x: 1240, y: 300 }"
|
|
|
|
|
|
+ :scroll="{ x: 990, y: 300 }"
|
|
bordered>
|
|
bordered>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -67,10 +67,10 @@
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse-panel key="1" header="已选产品">
|
|
<a-collapse-panel key="1" header="已选产品">
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
- <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
|
|
+ <a-alert type="info" style="margin-bottom:10px">
|
|
<div slot="message">
|
|
<div slot="message">
|
|
总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
|
|
总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
|
|
- 总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,
|
|
|
|
|
|
+ <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
|
|
总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
|
|
总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
|
|
</div>
|
|
</div>
|
|
</a-alert>
|
|
</a-alert>
|
|
@@ -78,7 +78,7 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :span="17">
|
|
<a-col :span="17">
|
|
<div class="table-page-search-wrapper">
|
|
<div class="table-page-search-wrapper">
|
|
- <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
|
|
|
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="9" :sm="24">
|
|
<a-col :md="9" :sm="24">
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
@@ -90,8 +90,8 @@
|
|
<a-input id="allocateBillEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
<a-input id="allocateBillEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
|
|
|
|
- <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
|
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
|
+ <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
<a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
|
|
<a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -99,25 +99,45 @@
|
|
</div>
|
|
</div>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="7" style="text-align: right;">
|
|
<a-col :span="7" style="text-align: right;">
|
|
- <!-- <a-button size="small" id="allocateBillEdit-import-btn">导入明细</a-button> -->
|
|
|
|
- <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
|
|
|
|
|
|
+ <a-button size="small" id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
|
|
|
|
+ <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <a-table
|
|
|
|
|
|
+ <s-table
|
|
class="sTable"
|
|
class="sTable"
|
|
ref="chooseTable"
|
|
ref="chooseTable"
|
|
size="small"
|
|
size="small"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="chooseColumns"
|
|
:columns="chooseColumns"
|
|
- :dataSource="chooseLoadData"
|
|
|
|
- :scroll="{ x: 1335, y: 300 }"
|
|
|
|
- :loading="loading"
|
|
|
|
- :pagination="choosePaginationProps"
|
|
|
|
|
|
+ :data="chooseLoadData"
|
|
|
|
+ :scroll="{ x: 1160, y: 300 }"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <!-- 售价 -->
|
|
|
|
+ <template slot="price" slot-scope="text, record, index">
|
|
|
|
+ <!-- 调往对象为经销商时不可编辑售价,为员工或其他时可编辑售价 -->
|
|
|
|
+ <div v-if="$route.params.dealerLevel == 'OTHER'">
|
|
|
|
+ <a-select
|
|
|
|
+ size="small"
|
|
|
|
+ id="allocateBillEdit-price"
|
|
|
|
+ option-label-prop="label"
|
|
|
|
+ v-model="record.price"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ @change="e => priceChange(e, record)"
|
|
|
|
+ @focus="e => priceFocus(record, index)"
|
|
|
|
+ style="width: 100%;">
|
|
|
|
+ <a-select-option v-if="record.cost" :value="record.cost" :label="record.cost">成本 {{ record.cost }}</a-select-option>
|
|
|
|
+ <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].provincePrice" :value="loadDataSource[index].provincePrice" :label="loadDataSource[index].provincePrice">A价 {{ loadDataSource[index].provincePrice }}</a-select-option>
|
|
|
|
+ <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].cityPrice" :value="loadDataSource[index].cityPrice" :label="loadDataSource[index].cityPrice">B价 {{ loadDataSource[index].cityPrice }}</a-select-option>
|
|
|
|
+ <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].specialPrice" :value="loadDataSource[index].specialPrice" :label="loadDataSource[index].specialPrice">C价 {{ loadDataSource[index].specialPrice }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </div>
|
|
|
|
+ <span v-else>{{ record.price }}</span>
|
|
|
|
+ </template>
|
|
<!-- 调出数量 -->
|
|
<!-- 调出数量 -->
|
|
<template slot="qty" slot-scope="text, record">
|
|
<template slot="qty" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
|
|
+ size="small"
|
|
id="allocateBillEdit-qty"
|
|
id="allocateBillEdit-qty"
|
|
v-model="record.qty"
|
|
v-model="record.qty"
|
|
:precision="0"
|
|
:precision="0"
|
|
@@ -131,22 +151,23 @@
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
|
|
<a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
|
|
</template>
|
|
</template>
|
|
- </a-table>
|
|
|
|
|
|
+ </s-table>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</a-collapse>
|
|
</a-card>
|
|
</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="allocateBillEdit-submit"
|
|
|
|
- size="large"
|
|
|
|
- class="button-primary"
|
|
|
|
- @click="handleSubmit"
|
|
|
|
- style="padding: 0 60px;">提交</a-button>
|
|
|
|
- </div>
|
|
|
|
- </a-affix>
|
|
|
|
</a-spin>
|
|
</a-spin>
|
|
|
|
+ <div class="affix-cont">
|
|
|
|
+ <a-button
|
|
|
|
+ type="primary"
|
|
|
|
+ id="allocateBillEdit-submit"
|
|
|
|
+ size="large"
|
|
|
|
+ :disabled="spinning"
|
|
|
|
+ class="button-primary"
|
|
|
|
+ @click="handleSubmit"
|
|
|
|
+ style="padding: 0 60px;">提交</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 导入产品 -->
|
|
|
|
+ <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
<!-- 打印 -->
|
|
<!-- 打印 -->
|
|
<div id="print"></div>
|
|
<div id="print"></div>
|
|
</div>
|
|
</div>
|
|
@@ -154,10 +175,12 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
|
|
+import ImportGuideModal from './importGuideModal.vue'
|
|
import { queryStockProductPage } from '@/api/stock'
|
|
import { queryStockProductPage } from '@/api/stock'
|
|
-import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint } from '@/api/allocateBill'
|
|
|
|
|
|
+import { productPriceInfo } from '@/api/product'
|
|
|
|
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert } from '@/api/allocateBill'
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect },
|
|
|
|
|
|
+ components: { STable, VSelect, ImportGuideModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
@@ -178,55 +201,78 @@ export default {
|
|
productTypeList: [], // 产品分类 下拉数据
|
|
productTypeList: [], // 产品分类 下拉数据
|
|
productType: [],
|
|
productType: [],
|
|
warehouseList: [], // 仓库 下拉数据
|
|
warehouseList: [], // 仓库 下拉数据
|
|
- // 表头
|
|
|
|
- columns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { 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: 'lastStockCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '售价', dataIndex: 'productPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
|
- ],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
- return queryStockProductPage(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: this.$route.params.dealerLevel })).then(res => {
|
|
|
|
|
|
+ return queryStockProductPage(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: this.$route.params.dealerLevel == 'OTHER' ? undefined : this.$route.params.dealerLevel })).then(res => {
|
|
const data = res.data
|
|
const data = res.data
|
|
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
|
|
}
|
|
}
|
|
|
|
+ this.loadDataSource = data.list || []
|
|
this.disabled = false
|
|
this.disabled = false
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 表头
|
|
|
|
- chooseColumns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 140, align: 'center' },
|
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { 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)
|
|
|
|
|
|
+ loadDataSource: [],
|
|
|
|
+ localDataSource: [],
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ chooseLoadData: parameter => {
|
|
|
|
+ this.chooseDisabled = true
|
|
|
|
+ const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.$route.params.sn })
|
|
|
|
+ return allocateBillDetailList(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].qtyBackups = data.list[i].qty
|
|
|
|
+ data.list[i].priceBackups = data.list[i].price
|
|
|
|
+ }
|
|
|
|
+ this.localDataSource = data.list || []
|
|
|
|
+ this.chooseDisabled = false
|
|
|
|
+ return data
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- productTotal: null // 合计
|
|
|
|
|
|
+ productTotal: null, // 合计
|
|
|
|
+ openGuideModal: false // 导入产品引导
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
|
|
+ ]
|
|
|
|
+ if (this.$hasPermissions('B_isShowCost')) {
|
|
|
|
+ arr.splice(4, 0, { title: '成本价', dataIndex: 'lastStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
|
|
+ },
|
|
|
|
+ chooseColumns () {
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '售价', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
|
|
|
|
+ { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
|
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
|
|
+ ]
|
|
|
|
+ if (this.$hasPermissions('B_isShowCost')) {
|
|
|
|
+ arr.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -247,18 +293,22 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 导入产品
|
|
|
|
+ hanldeOk (obj) {
|
|
|
|
+ allocateBillBatchInsert(obj).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$refs.chooseTable.refresh(true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 已选产品 重置
|
|
// 已选产品 重置
|
|
chooseResetSearchForm () {
|
|
chooseResetSearchForm () {
|
|
this.chooseQueryParam.productCode = ''
|
|
this.chooseQueryParam.productCode = ''
|
|
this.chooseQueryParam.productName = ''
|
|
this.chooseQueryParam.productName = ''
|
|
- this.choosePageNo = 1
|
|
|
|
- this.choosePageSize = 10
|
|
|
|
- this.choosePaginationProps.total = 0
|
|
|
|
- this.choosePaginationProps.current = 1
|
|
|
|
- this.getChooseProductList(1)
|
|
|
|
|
|
+ this.$refs.chooseTable.refresh(true)
|
|
},
|
|
},
|
|
// 添加/编辑
|
|
// 添加/编辑
|
|
- handleAdd (row, isEdit) {
|
|
|
|
|
|
+ handleAdd (row, isEdit, isRefresh) {
|
|
const params = {
|
|
const params = {
|
|
id: isEdit ? row.id : undefined,
|
|
id: isEdit ? row.id : undefined,
|
|
allocateSn: this.$route.params.sn,
|
|
allocateSn: this.$route.params.sn,
|
|
@@ -269,20 +319,25 @@ export default {
|
|
}
|
|
}
|
|
if (isEdit) { // 编辑
|
|
if (isEdit) { // 编辑
|
|
// 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
// 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
- if (!row.qty || row.qty == row.qtyBackups) {
|
|
|
|
|
|
+ if (!row.qty) {
|
|
row.qty = row.qtyBackups
|
|
row.qty = row.qtyBackups
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if (!row.price) {
|
|
|
|
+ row.price = row.priceBackups
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.spinning = true
|
|
this.spinning = true
|
|
allocateBillDetailSave(params).then(res => {
|
|
allocateBillDetailSave(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
- this.$refs.table.refresh()
|
|
|
|
- this.getChooseProductList()
|
|
|
|
|
|
+ if (isRefresh != 'noRefresh') {
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ this.$refs.chooseTable.refresh()
|
|
this.spinning = false
|
|
this.spinning = false
|
|
} else {
|
|
} else {
|
|
- row.qty = row.qtyBackups
|
|
|
|
this.spinning = false
|
|
this.spinning = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -302,7 +357,7 @@ export default {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
_this.$refs.table.refresh()
|
|
_this.$refs.table.refresh()
|
|
- _this.getChooseProductList()
|
|
|
|
|
|
+ _this.$refs.chooseTable.refresh()
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
} else {
|
|
} else {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
@@ -314,7 +369,7 @@ export default {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
_this.$refs.table.refresh()
|
|
_this.$refs.table.refresh()
|
|
- _this.getChooseProductList()
|
|
|
|
|
|
+ _this.$refs.chooseTable.refresh()
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
} else {
|
|
} else {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
@@ -354,49 +409,6 @@ export default {
|
|
handleBack () {
|
|
handleBack () {
|
|
this.$router.push({ path: '/allocationManagement/transferOut/list', query: { closeLastOldTab: true } })
|
|
this.$router.push({ path: '/allocationManagement/transferOut/list', query: { closeLastOldTab: true } })
|
|
},
|
|
},
|
|
- // 已选产品 分页 一页多少条change
|
|
|
|
- changeChoosePageSize (current, pageSize) {
|
|
|
|
- this.choosePageNo = current
|
|
|
|
- this.choosePageSize = pageSize
|
|
|
|
- this.getChooseProductList()
|
|
|
|
- },
|
|
|
|
- // 已选产品 分页 页码change
|
|
|
|
- changeChoosePage (current) {
|
|
|
|
- this.choosePageNo = current
|
|
|
|
- this.getChooseProductList()
|
|
|
|
- },
|
|
|
|
- // 已选产品列表数据
|
|
|
|
- getChooseProductList (pageNo) {
|
|
|
|
- this.choosePageNo = this.choosePageNo || pageNo
|
|
|
|
- this.chooseDisabled = true
|
|
|
|
- this.loading = true
|
|
|
|
- const params = {
|
|
|
|
- pageNo: this.choosePageNo,
|
|
|
|
- pageSize: this.choosePageSize,
|
|
|
|
- allocateSn: this.$route.params.sn
|
|
|
|
- }
|
|
|
|
- allocateBillDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
|
|
|
|
- this.loading = false
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- // 合计
|
|
|
|
- this.getDetailCount(Object.assign(params, this.chooseQueryParam))
|
|
|
|
- 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].qtyBackups = data.list[i].qty
|
|
|
|
- }
|
|
|
|
- this.chooseLoadData = data.list
|
|
|
|
- this.chooseDisabled = false
|
|
|
|
- } else {
|
|
|
|
- this.choosePaginationProps.total = 0
|
|
|
|
- this.choosePaginationProps.current = 1
|
|
|
|
- this.chooseLoadData = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 已选产品 调出数量 blur
|
|
// 已选产品 调出数量 blur
|
|
qtyBlur (val, record) {
|
|
qtyBlur (val, record) {
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
@@ -404,6 +416,25 @@ export default {
|
|
this.handleAdd(record, 'edit')
|
|
this.handleAdd(record, 'edit')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 已选产品 售价 change
|
|
|
|
+ priceChange (val, record) {
|
|
|
|
+ // 光标移出,值发生改变再调用编辑接口
|
|
|
|
+ if (val != record.priceBackups) {
|
|
|
|
+ this.handleAdd(record, 'edit', 'noRefresh')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 获取价格
|
|
|
|
+ priceFocus (row, index) {
|
|
|
|
+ if (row.productSn) {
|
|
|
|
+ productPriceInfo({ sn: row.productSn }).then(res => {
|
|
|
|
+ if (res.status == 200 && res.data) {
|
|
|
|
+ this.loadDataSource[index].provincePrice = res.data.provincePrice || undefined
|
|
|
|
+ this.loadDataSource[index].cityPrice = res.data.cityPrice || undefined
|
|
|
|
+ this.loadDataSource[index].specialPrice = res.data.specialPrice || undefined
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 打印预览/快捷打印
|
|
// 打印预览/快捷打印
|
|
handlePrint (type) {
|
|
handlePrint (type) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -440,15 +471,21 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
- next(vm => {
|
|
|
|
- vm.getChooseProductList(1)
|
|
|
|
- })
|
|
|
|
|
|
+ next(vm => {})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
.allocateBillEdit-wrap{
|
|
.allocateBillEdit-wrap{
|
|
|
|
+ position: relative;
|
|
|
|
+ height: 100%;
|
|
|
|
+ padding-bottom: 51px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ >.ant-spin-nested-loading{
|
|
|
|
+ overflow-y: scroll;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
.allocateBillEdit-back{
|
|
.allocateBillEdit-back{
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|