|
@@ -1,19 +1,19 @@
|
|
|
<template>
|
|
|
- <div class="storeTransferOutEdit-wrap">
|
|
|
- <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutEdit-back" >
|
|
|
+ <div class="allocateBillEdit-wrap">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
- <a id="storeTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
- <span style="margin: 0 15px;color: #666;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
|
|
|
+ <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
+ <span style="margin: 0 15px;color: #666;">调往对象:{{ $route.params.name || '--' }}</span>
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
<template slot="extra">
|
|
|
- <a-button key="2" id="storeTransferOutEdit-preview-btn">打印预览</a-button>
|
|
|
- <a-button key="1" type="primary" id="storeTransferOutEdit-print-btn">快速打印</a-button>
|
|
|
+ <a-button key="2" id="allocateBillEdit-preview-btn">打印预览</a-button>
|
|
|
+ <a-button key="1" type="primary" id="allocateBillEdit-print-btn">快速打印</a-button>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 选择产品 -->
|
|
|
- <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
|
|
|
+ <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
|
|
|
<a-collapse :activeKey="['1']">
|
|
|
<a-collapse-panel key="1" header="选择产品">
|
|
|
<!-- 筛选条件 -->
|
|
@@ -22,58 +22,22 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
|
- <a-input id="storeTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
+ <a-input id="allocateBillEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品名称" prop="productName">
|
|
|
- <a-input id="storeTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
+ <a-input id="allocateBillEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="仓库">
|
|
|
- <a-select id="storeTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
|
|
|
- <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
+ <a-form-item label="原厂编码" prop="productOrigCode">
|
|
|
+ <a-input id="allocateBillEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <template v-if="advanced">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品分类">
|
|
|
- <a-cascader
|
|
|
- @change="changeProductType"
|
|
|
- change-on-select
|
|
|
- v-model="productType"
|
|
|
- expand-trigger="hover"
|
|
|
- :options="productTypeList"
|
|
|
- :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
- id="storeTransferOutEdit-productType"
|
|
|
- placeholder="请选择产品分类"
|
|
|
- allowClear />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品品牌">
|
|
|
- <a-select
|
|
|
- placeholder="请选择产品品牌"
|
|
|
- id="storeTransferOutEdit-brandSn"
|
|
|
- allowClear
|
|
|
- v-model="queryParam.brandSn"
|
|
|
- :showSearch="true"
|
|
|
- option-filter-prop="children"
|
|
|
- :filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </template>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 24px;">
|
|
|
<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 @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
- {{ advanced ? '收起' : '展开' }}
|
|
|
- <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
- </a>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -83,43 +47,42 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
|
|
|
+ :rowKey="(record) => record.stockSn"
|
|
|
:columns="columns"
|
|
|
:customRow="handleClickRow"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1180, y: 300 }"
|
|
|
- :defaultLoadData="false"
|
|
|
+ :scroll="{ x: 1240, y: 300 }"
|
|
|
bordered>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="storeTransferOutEdit-add-btn">添加</a-button>
|
|
|
+ <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="allocateBillEdit-add-btn">添加</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
|
</a-card>
|
|
|
<!-- 已选产品 -->
|
|
|
- <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
|
|
|
+ <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
|
|
|
<a-collapse :activeKey="['1']">
|
|
|
<a-collapse-panel key="1" header="已选产品">
|
|
|
<!-- 总计 -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
|
|
|
+ <div slot="message">总数量:<strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,总成本(¥):<strong>{{ (productTotal&&productTotal.totalCost) || 0 }}</strong> ,总售价(¥):<strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
|
|
|
</a-alert>
|
|
|
<!-- 筛选条件 -->
|
|
|
<a-row :gutter="15">
|
|
|
- <a-col :span="20">
|
|
|
+ <a-col :span="17">
|
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
|
|
|
<a-row :gutter="15">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="9" :sm="24">
|
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
|
- <a-input id="storeTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
+ <a-input id="allocateBillEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="9" :sm="24">
|
|
|
<a-form-item label="产品名称" prop="productName">
|
|
|
- <a-input id="storeTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
+ <a-input id="allocateBillEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 24px;">
|
|
@@ -130,8 +93,9 @@
|
|
|
</a-form>
|
|
|
</div>
|
|
|
</a-col>
|
|
|
- <a-col :span="4" style="text-align: right;">
|
|
|
- <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
|
|
|
+ <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-col>
|
|
|
</a-row>
|
|
|
<!-- 列表 -->
|
|
@@ -146,20 +110,20 @@
|
|
|
:pagination="choosePaginationProps"
|
|
|
bordered>
|
|
|
<!-- 调出数量 -->
|
|
|
- <template slot="outQty" slot-scope="text, record">
|
|
|
+ <template slot="qty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="storeTransferOutEdit-outQty"
|
|
|
- v-model="record.outQty"
|
|
|
+ id="allocateBillEdit-qty"
|
|
|
+ v-model="record.qty"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
|
placeholder="请输入"
|
|
|
- @blur="e => outQtyBlur(e.target.value, record)"
|
|
|
+ @blur="e => qtyBlur(e.target.value, record)"
|
|
|
style="width: 100%;" />
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
|
|
|
+ <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</a-collapse-panel>
|
|
@@ -169,7 +133,7 @@
|
|
|
<div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
- id="storeTransferOutEdit-submit"
|
|
|
+ id="allocateBillEdit-submit"
|
|
|
size="large"
|
|
|
class="button-primary"
|
|
|
@click="handleSubmit"
|
|
@@ -181,12 +145,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
-import { storeCallOutDetailList, storeCallOutDetail, storeCallOutDetailCount, storeCallOutDetailSave, storeCallOutDetailDel, storeCallOutSubmit } from '@/api/storeCallOut'
|
|
|
-import { productBrandQuery } from '@/api/productBrand'
|
|
|
-import { productTypeList } from '@/api/productType'
|
|
|
-import { warehouseAllList } from '@/api/warehouse'
|
|
|
-import { productQuery } from '@/api/allocWarehouse'
|
|
|
+import { queryStockProductPage } from '@/api/stock'
|
|
|
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll } from '@/api/allocateBill'
|
|
|
export default {
|
|
|
components: { STable, VSelect },
|
|
|
data () {
|
|
@@ -194,11 +154,7 @@ export default {
|
|
|
queryParam: {
|
|
|
productCode: '',
|
|
|
productName: '',
|
|
|
- warehouseSn: undefined,
|
|
|
- brandSn: undefined,
|
|
|
- productTypeSn1: undefined,
|
|
|
- productTypeSn2: undefined,
|
|
|
- productTypeSn3: undefined
|
|
|
+ productOrigCode: ''
|
|
|
},
|
|
|
chooseQueryParam: {
|
|
|
productCode: '',
|
|
@@ -214,19 +170,19 @@ export default {
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
- { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '成本价(¥)', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { 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 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- return productQuery(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return queryStockProductPage(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++) {
|
|
@@ -239,14 +195,14 @@ export default {
|
|
|
// 表头
|
|
|
chooseColumns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
- { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '成本价(¥)', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
|
|
|
- { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, 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: [],
|
|
@@ -259,7 +215,6 @@ export default {
|
|
|
onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
|
|
|
onChange: (current) => this.changeChoosePage(current)
|
|
|
},
|
|
|
- basicInfoData: null, // 基本信息
|
|
|
productTotal: null // 合计
|
|
|
}
|
|
|
},
|
|
@@ -268,11 +223,7 @@ export default {
|
|
|
resetSearchForm () {
|
|
|
this.queryParam.productCode = ''
|
|
|
this.queryParam.productName = ''
|
|
|
- this.queryParam.warehouseSn = undefined
|
|
|
- this.queryParam.brandSn = undefined
|
|
|
- this.queryParam.productTypeSn1 = undefined
|
|
|
- this.queryParam.productTypeSn2 = undefined
|
|
|
- this.queryParam.productTypeSn3 = undefined
|
|
|
+ this.queryParam.productOrigCode = ''
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 双击快速添加
|
|
@@ -291,41 +242,24 @@ export default {
|
|
|
this.chooseQueryParam.productName = ''
|
|
|
this.getChooseProductList(1)
|
|
|
},
|
|
|
- // 基本信息
|
|
|
- getDetail () {
|
|
|
- storeCallOutDetail({ id: this.$route.params.id }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.basicInfoData = res.data
|
|
|
- } else {
|
|
|
- this.basicInfoData = null
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 添加/编辑
|
|
|
handleAdd (row, isEdit) {
|
|
|
const params = {
|
|
|
id: isEdit ? row.id : undefined,
|
|
|
- storeCallOutSn: this.$route.params.sn,
|
|
|
- outCost: isEdit ? row.outCost : row.putCost,
|
|
|
- outQty: isEdit ? row.outQty : 1, // 添加时调出数量默认为1
|
|
|
- productSn: row.productSn,
|
|
|
- productCode: row.productCode,
|
|
|
- productOrigCode: row.productOrigCode || undefined,
|
|
|
- productTypeSn1: row.productTypeSn1,
|
|
|
- productTypeSn2: row.productTypeSn2,
|
|
|
- productTypeSn3: row.productTypeSn3,
|
|
|
- brandSn: row.brandSn,
|
|
|
- warehouseSn: row.warehouseSn,
|
|
|
- warehouseLocationSn: row.warehouseLocationSn
|
|
|
+ allocateSn: this.$route.params.sn,
|
|
|
+ cost: isEdit ? row.cost : row.lastStockCost,
|
|
|
+ price: isEdit ? row.price : row.productPrice,
|
|
|
+ qty: isEdit ? row.qty : 1, // 添加时调出数量默认为1
|
|
|
+ productSn: row.productSn
|
|
|
}
|
|
|
if (isEdit) { // 编辑
|
|
|
// 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
|
- if (!row.outQty || row.outQty == row.outQtyBackups) {
|
|
|
- row.outQty = row.outQtyBackups
|
|
|
+ if (!row.qty || row.qty == row.qtyBackups) {
|
|
|
+ row.qty = row.qtyBackups
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- storeCallOutDetailSave(params).then(res => {
|
|
|
+ allocateBillDetailSave(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.success(res.message)
|
|
|
this.$refs.table.refresh()
|
|
@@ -334,27 +268,38 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 删除
|
|
|
- handleDel (row) {
|
|
|
+ handleDel (row, isAll) {
|
|
|
const _this = this
|
|
|
+ const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: '删除后不可恢复,确定要进行删除吗?',
|
|
|
+ content: content,
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- storeCallOutDetailDel({ id: row.id }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- _this.$message.success(res.message)
|
|
|
- _this.$refs.table.refresh()
|
|
|
- _this.getChooseProductList()
|
|
|
- }
|
|
|
- })
|
|
|
+ if (isAll) { // 整单删除
|
|
|
+ allocateBillDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ _this.getChooseProductList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else { // 单个删除
|
|
|
+ allocateBillDetailDel({ id: row.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ _this.getChooseProductList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 提交
|
|
|
handleSubmit () {
|
|
|
const _this = this
|
|
|
- storeCallOutSubmit({ id: this.$route.params.id }).then(res => {
|
|
|
+ allocateBillSubmit({ sn: this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.success(res.message)
|
|
|
setTimeout(() => {
|
|
@@ -365,7 +310,7 @@ export default {
|
|
|
},
|
|
|
// 合计
|
|
|
getDetailCount (params) {
|
|
|
- storeCallOutDetailCount(params).then(res => {
|
|
|
+ allocateBillDetailCount(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.productTotal = res.data
|
|
|
} else {
|
|
@@ -373,10 +318,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 导入明细
|
|
|
- handleImport () {
|
|
|
- console.log(333)
|
|
|
- },
|
|
|
// 返回列表
|
|
|
handleBack () {
|
|
|
this.$router.push({ path: '/allocationManagement/transferOut/list' })
|
|
@@ -399,9 +340,9 @@ export default {
|
|
|
const params = {
|
|
|
pageNo: this.choosePageNo,
|
|
|
pageSize: this.choosePageSize,
|
|
|
- storeCallOutSn: this.$route.params.sn
|
|
|
+ allocateSn: this.$route.params.sn
|
|
|
}
|
|
|
- storeCallOutDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
|
|
|
+ allocateBillDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
// 合计
|
|
|
this.getDetailCount(Object.assign(params, this.chooseQueryParam))
|
|
@@ -411,9 +352,7 @@ export default {
|
|
|
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].outQtyBackups = data.list[i].outQty
|
|
|
- // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
- data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
|
|
|
+ data.list[i].qtyBackups = data.list[i].qty
|
|
|
}
|
|
|
this.chooseLoadData = data.list
|
|
|
this.chooseDisabled = false
|
|
@@ -425,73 +364,27 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 已选产品 调出数量 blur
|
|
|
- outQtyBlur (val, record) {
|
|
|
+ qtyBlur (val, record) {
|
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
|
- if (val != record.outQtyBackups) {
|
|
|
+ if (val != record.qtyBackups) {
|
|
|
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] : ''
|
|
|
- },
|
|
|
- // 产品品牌 列表
|
|
|
- getProductBrand () {
|
|
|
- // sysFlag不传,此处应查询所有产品
|
|
|
- productBrandQuery({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productBrandList = res.data
|
|
|
- } else {
|
|
|
- this.productBrandList = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 产品分类 列表
|
|
|
- getProductType () {
|
|
|
- productTypeList({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.productTypeList = res.data
|
|
|
- } else {
|
|
|
- this.productTypeList = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 仓库下拉数据
|
|
|
- getWarehouseList (type) {
|
|
|
- warehouseAllList({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.warehouseList = res.data
|
|
|
- } else {
|
|
|
- this.warehouseList = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
- vm.getDetail()
|
|
|
vm.getChooseProductList(1)
|
|
|
- vm.getWarehouseList()
|
|
|
- vm.getProductBrand()
|
|
|
- vm.getProductType()
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
- .storeTransferOutEdit-wrap{
|
|
|
- .storeTransferOutEdit-back{
|
|
|
+ .allocateBillEdit-wrap{
|
|
|
+ .allocateBillEdit-back{
|
|
|
margin-bottom: 15px;
|
|
|
}
|
|
|
- .storeTransferOutEdit-cont{
|
|
|
+ .allocateBillEdit-cont{
|
|
|
margin-bottom: 15px;
|
|
|
.sub-title{
|
|
|
font-size: 12px;
|