|
@@ -1,9 +1,11 @@
|
|
|
<template>
|
|
|
<div class="warehouseAllocationEdit-wrap">
|
|
|
- <a-page-header :ghost="false" @back="handleBack" class="warehouseAllocationEdit-back">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationEdit-back" >
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
- <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
|
|
|
+ <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
+ <span style="margin: 0 15px;color: #666;">调出仓库:{{ (basicInfoData&&basicInfoData.outWarehouseName) || '--' }}</span>
|
|
|
+ <span style="margin: 0 15px;color: #666;">调入仓库:{{ (basicInfoData&&basicInfoData.putWarehouseName) || '--' }}</span>
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
<template slot="extra">
|
|
@@ -11,85 +13,68 @@
|
|
|
<a-button key="1" type="primary" id="warehouseAllocationEdit-print-btn">快速打印</a-button>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
- <!-- 基础信息 -->
|
|
|
- <a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
|
|
|
- <a-collapse :activeKey="['1']">
|
|
|
- <a-collapse-panel key="1">
|
|
|
- <template slot="header">
|
|
|
- 基础信息
|
|
|
- <a-button
|
|
|
- type="primary"
|
|
|
- shape="circle"
|
|
|
- size="small"
|
|
|
- icon="edit"
|
|
|
- class="edit-circle-btn"
|
|
|
- id="warehouseAllocationEdit-circle-btn"
|
|
|
- @click.stop="handleEditInfo" />
|
|
|
- </template>
|
|
|
- <a-descriptions :column="3">
|
|
|
- <a-descriptions-item label="调出仓库">箭冠营销中心</a-descriptions-item>
|
|
|
- <a-descriptions-item label="调入仓库">箭冠营销中心</a-descriptions-item>
|
|
|
- </a-descriptions>
|
|
|
- </a-collapse-panel>
|
|
|
- </a-collapse>
|
|
|
- </a-card>
|
|
|
<!-- 选择产品 -->
|
|
|
<a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
|
|
|
<a-collapse :activeKey="['1']">
|
|
|
<a-collapse-panel key="1" header="选择产品">
|
|
|
<!-- 筛选条件 -->
|
|
|
<div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="getProductList(1)">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品编码" prop="name">
|
|
|
- <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
+ <a-input id="warehouseAllocationEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品名称" prop="name">
|
|
|
- <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
+ <a-input id="warehouseAllocationEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="原厂编码" prop="name">
|
|
|
- <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入原厂编码" allowClear />
|
|
|
+ <a-form-item label="原厂编码" prop="productOrigCode">
|
|
|
+ <a-input id="warehouseAllocationEdit-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-select
|
|
|
- placeholder="请选择"
|
|
|
- id="warehouseAllocationEdit-state"
|
|
|
+ placeholder="请选择产品品牌"
|
|
|
+ id="warehouseAllocationEdit-brandSn"
|
|
|
allowClear
|
|
|
- v-model="queryParam.dataSourceNo"
|
|
|
+ v-model="queryParam.brandSn"
|
|
|
:showSearch="true"
|
|
|
option-filter-prop="children"
|
|
|
:filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
|
+ <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>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品类别">
|
|
|
- <a-cascader :options="typeData" id="warehouseAllocationEdit-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
|
|
|
+ <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="warehouseAllocationEdit-productType"
|
|
|
+ placeholder="请选择产品分类"
|
|
|
+ allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="调出仓位">
|
|
|
- <v-select
|
|
|
- v-model="queryParam.billStatus"
|
|
|
- ref="billStatus"
|
|
|
- id="warehouseAllocationEdit-billStatus"
|
|
|
- code="PAYMENT_TYPE"
|
|
|
- placeholder="请选择调出仓位"
|
|
|
- allowClear></v-select>
|
|
|
+ <a-form-item label="调出仓位" prop="warehouseLocationSn">
|
|
|
+ <a-select id="warehouseAllocationEdit-warehouseLocationSn" placeholder="请选择" allowClear v-model="queryParam.warehouseLocationSn" style="width: 100%;">
|
|
|
+ <a-select-option v-for="item in warehouseOutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</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="warehouseAllocationList-refresh">查询</a-button>
|
|
|
+ <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
@@ -100,36 +85,45 @@
|
|
|
</a-form>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
- <s-table
|
|
|
+ <a-table
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
- size="default"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
|
|
|
:columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :scroll="{ x: 1560 }"
|
|
|
+ :customRow="handleClickRow"
|
|
|
+ :dataSource="loadData"
|
|
|
+ :scroll="{ x: 1880, y: 300 }"
|
|
|
+ :pagination="paginationProps"
|
|
|
bordered>
|
|
|
+ <!-- 产品分类 -->
|
|
|
+ <template slot="productType" slot-scope="text, record">
|
|
|
+ <span v-if="record.dealerProduct.productTypeName2 || record.dealerProduct.productTypeName3">{{ record.dealerProduct.productTypeName2 }} {{ record.dealerProduct.productTypeName3 ? '>' : '' }} {{ record.dealerProduct.productTypeName3 }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
<!-- 调入仓位 -->
|
|
|
- <template slot="storageQuantity" slot-scope="text, record">
|
|
|
- <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
|
|
|
- <a-select-option v-for="item in typeData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
|
+ <template slot="putWarehouseLocationSn" slot-scope="text, record">
|
|
|
+ <a-select id="warehouseAllocationEdit-putWarehouseLocationSn" placeholder="请选择" v-model="record.putWarehouseLocationSn" style="width: 100%;">
|
|
|
+ <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</template>
|
|
|
<!-- 调出数量 -->
|
|
|
- <template slot="transferOutQuantity" slot-scope="text, record">
|
|
|
+ <template slot="outQty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="warehouseAllocationEdit-storageQuantity"
|
|
|
- :value="record.storageQuantity"
|
|
|
+ id="warehouseAllocationEdit-outQty"
|
|
|
+ v-model="record.outQty"
|
|
|
:precision="0"
|
|
|
- :min="0"
|
|
|
- :max="999999"
|
|
|
- placeholder="请输入" />
|
|
|
+ :min="1"
|
|
|
+ :max="record.currentQty"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="link" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
|
|
|
+ <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
|
|
|
</template>
|
|
|
- </s-table>
|
|
|
+ </s-table>
|
|
|
+ </a-table>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
|
</a-card>
|
|
@@ -139,213 +133,314 @@
|
|
|
<a-collapse-panel key="1" header="已选产品">
|
|
|
<!-- 总计 -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div slot="message">总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> ,总款数: <strong>6</strong> </div>
|
|
|
+ <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
|
|
|
</a-alert>
|
|
|
<!-- 筛选条件 -->
|
|
|
<a-row :gutter="15" justify="space-between">
|
|
|
<a-col :span="17">
|
|
|
<div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="9" :sm="24">
|
|
|
- <a-form-item label="产品编码" prop="name">
|
|
|
- <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
+ <a-input id="warehouseAllocationEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="9" :sm="24">
|
|
|
- <a-form-item label="产品名称" prop="name">
|
|
|
- <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
+ <a-input id="warehouseAllocationEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 24px;">
|
|
|
- <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="warehouseAllocationList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="warehouseAllocationList-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
</a-col>
|
|
|
<a-col :span="7">
|
|
|
- <a-button size="small" type="primary" id="warehouseAllocationEdit-pladd-btn" style="margin-bottom: 8px;">批量添加</a-button>
|
|
|
- <a-button size="small" id="warehouseAllocationEdit-import-btn" style="margin-left: 8px">导入明细</a-button>
|
|
|
- <a-button size="small" type="danger" id="warehouseAllocationEdit-del-all-btn" style="margin: 0 0 8px 8px;">整单删除</a-button>
|
|
|
+ <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button>
|
|
|
+ <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<!-- 列表 -->
|
|
|
- <s-table
|
|
|
+ <a-table
|
|
|
class="sTable"
|
|
|
ref="chooseTable"
|
|
|
- size="default"
|
|
|
+ size="small"
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="chooseColumns"
|
|
|
- :data="chooseLoadData"
|
|
|
- :scroll="{ x: 1460 }"
|
|
|
+ :dataSource="chooseLoadData"
|
|
|
+ :scroll="{ x: 1680, y: 300 }"
|
|
|
+ :pagination="choosePaginationProps"
|
|
|
bordered>
|
|
|
+ <!-- 产品分类 -->
|
|
|
+ <template slot="productType" slot-scope="text, record">
|
|
|
+ <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
<!-- 调入仓位 -->
|
|
|
- <template slot="storageQuantity" slot-scope="text, record">
|
|
|
- <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
|
|
|
- <a-select-option v-for="item in typeData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
|
+ <template slot="putWarehouseLocationSn" slot-scope="text, record">
|
|
|
+ <a-select
|
|
|
+ id="warehouseAllocationEdit-putWarehouseLocationSn"
|
|
|
+ @change="chooseWarehouseLocChange(record)"
|
|
|
+ placeholder="请选择"
|
|
|
+ v-model="record.putWarehouseLocationSn"
|
|
|
+ style="width: 100%;">
|
|
|
+ <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
|
|
|
</a-select>
|
|
|
</template>
|
|
|
<!-- 调出数量 -->
|
|
|
- <template slot="transferOutQuantity" slot-scope="text, record">
|
|
|
+ <template slot="outQty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="warehouseAllocationEdit-storageQuantity"
|
|
|
- :value="record.storageQuantity"
|
|
|
+ id="warehouseAllocationEdit-outQty"
|
|
|
+ v-model="record.outQty"
|
|
|
:precision="0"
|
|
|
- :min="0"
|
|
|
+ :min="1"
|
|
|
:max="999999"
|
|
|
- placeholder="请输入" />
|
|
|
+ placeholder="请输入"
|
|
|
+ @blur="e => outQtyBlur(e.target.value, record)"
|
|
|
+ style="width: 100%;" />
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="link" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
|
|
|
+ <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
|
|
|
</template>
|
|
|
- </s-table>
|
|
|
+ </a-table>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
|
</a-card>
|
|
|
<a-affix :offset-bottom="0">
|
|
|
- <div style="text-align: center;width: 100%;background-color: #fff;padding: 30px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
|
- <a-button type="primary" id="warehouseAllocationEdit-submit" size="large" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
|
|
|
+ <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ id="warehouseAllocationEdit-submit"
|
|
|
+ size="large"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleSubmit"
|
|
|
+ style="padding: 0 60px;">提交</a-button>
|
|
|
</div>
|
|
|
</a-affix>
|
|
|
- <!-- 选择基本信息弹框 -->
|
|
|
- <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import basicInfoModal from './basicInfoModal.vue'
|
|
|
+import { allocWarehouseDetailList, allocWarehouseDetail, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
|
|
|
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
+import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
+import { warehouseLocAllList } from '@/api/warehouse'
|
|
|
+
|
|
|
export default {
|
|
|
- components: { STable, VSelect, basicInfoModal },
|
|
|
+ components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
queryParam: {
|
|
|
-
|
|
|
+ productCode: '',
|
|
|
+ productName: '',
|
|
|
+ productOrigCode: '', // 原厂编码
|
|
|
+ brandSn: undefined,
|
|
|
+ productTypeSn1: undefined,
|
|
|
+ productTypeSn2: undefined,
|
|
|
+ productTypeSn3: undefined,
|
|
|
+ warehouseLocationSn: undefined // 调出仓位
|
|
|
+ },
|
|
|
+ chooseQueryParam: {
|
|
|
+ productCode: '',
|
|
|
+ productName: ''
|
|
|
},
|
|
|
- brandData: [], // 产品品牌 下拉数据
|
|
|
- typeData: [], // 产品类别 下拉数据
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ chooseDisabled: false, // 查询、重置按钮是否可操作
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
+ productBrandList: [], // 产品品牌 下拉数据
|
|
|
+ productTypeList: [], // 产品分类 下拉数据
|
|
|
+ productType: [],
|
|
|
+ warehousePutLocData: [], // 调入仓位 下拉数据
|
|
|
+ warehouseOutLocData: [], // 调出仓位 下拉数据
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'custNahme', width: 200, align: 'center', ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '品牌', dataIndex: 'custsNsame', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '类别', dataIndex: 'custsNdame', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '调出仓位', dataIndex: 'custsNafme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '调入仓位', scopedSlots: { customRender: 'storageQuantity' }, width: 140, align: 'center' },
|
|
|
- { title: '库存数量', dataIndex: 'custsNagme', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'custsNsagme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center', ellipsis: true },
|
|
|
+ { title: '调出仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: 140, align: 'center' },
|
|
|
+ { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
|
|
|
+ { title: '可用库存数', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '冻结库存数', dataIndex: 'freezeQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'unit', 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 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', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
|
|
|
- ],
|
|
|
- count: 10
|
|
|
- }
|
|
|
- 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)
|
|
|
},
|
|
|
// 表头
|
|
|
chooseColumns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'creatDaite', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'custNayme', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原厂编码', dataIndex: 'custNdayme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '品牌', dataIndex: 'mementPsay', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '类别', dataIndex: 'mementPay', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '调出仓位', scopedSlots: { customRender: 'storageQuantity' }, width: 140, align: 'center' },
|
|
|
- { title: '调入仓位', dataIndex: 'custsNakme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位', dataIndex: 'custssNakme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center', ellipsis: true },
|
|
|
+ { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: 140, align: 'center' },
|
|
|
+ { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
|
|
|
+ { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
- chooseLoadData: 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', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
|
|
|
- ],
|
|
|
- count: 10
|
|
|
- }
|
|
|
- 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)
|
|
|
- })
|
|
|
+ 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)
|
|
|
},
|
|
|
- openModal: false // 选择基本信息弹框是否显示
|
|
|
+ basicInfoData: null, // 基本信息
|
|
|
+ productTotal: null // 合计
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
// 重置
|
|
|
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.productCode = ''
|
|
|
+ this.queryParam.productName = ''
|
|
|
+ this.queryParam.productOrigCode = ''
|
|
|
+ this.queryParam.brandSn = undefined
|
|
|
+ this.queryParam.productTypeSn1 = undefined
|
|
|
+ this.queryParam.productTypeSn2 = undefined
|
|
|
+ this.queryParam.productTypeSn3 = undefined
|
|
|
+ this.queryParam.warehouseLocationSn = undefined
|
|
|
+ this.productType = []
|
|
|
+ this.getProductList(1)
|
|
|
},
|
|
|
- // 添加
|
|
|
- handleAdd (row) {},
|
|
|
- // 删除
|
|
|
- handleDel (row) {},
|
|
|
- // 编辑基本信息
|
|
|
- handleEditInfo () {
|
|
|
- this.openModal = true
|
|
|
+ // 双击快速添加
|
|
|
+ handleClickRow (record) {
|
|
|
+ return {
|
|
|
+ on: {
|
|
|
+ dblclick: (event) => {
|
|
|
+ this.handleAdd(record)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- // 基本信息 保存
|
|
|
- handleOk () {
|
|
|
-
|
|
|
+ // 已选产品 重置
|
|
|
+ chooseResetSearchForm () {
|
|
|
+ this.chooseQueryParam.productCode = ''
|
|
|
+ this.chooseQueryParam.productName = ''
|
|
|
+ this.getChooseProductList(1)
|
|
|
+ },
|
|
|
+ // 基本信息
|
|
|
+ getDetail () {
|
|
|
+ allocWarehouseDetail({ id: this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.basicInfoData = res.data
|
|
|
+ this.getWarehouseLoc(res.data.putWarehouseSn, 'put')
|
|
|
+ this.getWarehouseLoc(res.data.outWarehouseSn, 'out')
|
|
|
+ } else {
|
|
|
+ this.basicInfoData = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 添加/编辑
|
|
|
+ handleAdd (row, isEdit) {
|
|
|
+ if (!isEdit && !row.putWarehouseLocationSn) {
|
|
|
+ this.$message.warning('请选择调入仓位后再添加!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!isEdit && !row.outQty) {
|
|
|
+ this.$message.warning('请输入调出数量后再添加!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ id: isEdit ? row.id : undefined,
|
|
|
+ allocationWarehouseSn: this.$route.params.sn,
|
|
|
+ allocationCost: isEdit ? row.allocationCost : row.putCost,
|
|
|
+ allocationQty: row.outQty,
|
|
|
+ brandSn: row.brandSn,
|
|
|
+ outWarehouseLocationSn: isEdit ? row.outWarehouseLocationSn : row.warehouseLocationSn,
|
|
|
+ productCode: row.productCode,
|
|
|
+ productOrigCode: row.productOrigCode || undefined,
|
|
|
+ productSn: row.productSn,
|
|
|
+ productTypeSn1: row.productTypeSn1,
|
|
|
+ productTypeSn2: row.productTypeSn2,
|
|
|
+ productTypeSn3: row.productTypeSn3,
|
|
|
+ putWarehouseLocationSn: row.putWarehouseLocationSn
|
|
|
+ }
|
|
|
+ if (isEdit) { // 编辑
|
|
|
+ // 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
|
+ if (!row.outQty || row.outQty == row.outQtyBackups) {
|
|
|
+ row.outQty = row.outQtyBackups
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ allocWarehouseDetailSave(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.getProductList()
|
|
|
+ this.getChooseProductList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ handleDel (row, isAll) {
|
|
|
+ const _this = this
|
|
|
+ const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: content,
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ let params
|
|
|
+ if (isAll) { // 整单删除
|
|
|
+ params = { allocationWarehouseSn: _this.$route.params.sn }
|
|
|
+ } else { // 单个删除
|
|
|
+ params = { id: row.id }
|
|
|
+ }
|
|
|
+ allocWarehouseDetailDel(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.getProductList()
|
|
|
+ _this.getChooseProductList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 提交
|
|
|
- handleSubmit () {},
|
|
|
+ handleSubmit () {
|
|
|
+ const _this = this
|
|
|
+ allocWarehouseSubmit({ id: this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.handleBack()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 合计
|
|
|
+ getDetailCount (params) {
|
|
|
+ allocWarehouseDetailCount(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.productTotal = res.data
|
|
|
+ } else {
|
|
|
+ this.productTotal = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 导入明细
|
|
|
handleImport () {
|
|
|
console.log(333)
|
|
@@ -354,15 +449,144 @@ export default {
|
|
|
handleBack () {
|
|
|
this.$router.push({ path: '/allocationManagement/warehouseAllocation/list' })
|
|
|
},
|
|
|
+ // 产品列表数据
|
|
|
+ getProductList (pageNo) {
|
|
|
+ this.disabled = true
|
|
|
+ this.pageNo = pageNo || this.pageNo
|
|
|
+ const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
|
|
|
+ params.enabledFlag = 1
|
|
|
+ productQuery(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ const data = res.data
|
|
|
+ this.paginationProps.total = Number(res.data.count) || 0
|
|
|
+ this.paginationProps.current = this.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.getProductList()
|
|
|
+ },
|
|
|
+ // 分页 页码change
|
|
|
+ changePage (current) {
|
|
|
+ this.pageNo = current
|
|
|
+ this.getProductList()
|
|
|
+ },
|
|
|
+ // 已选产品 分页 一页多少条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
|
|
|
+ const params = {
|
|
|
+ pageNo: this.choosePageNo,
|
|
|
+ pageSize: this.choosePageSize,
|
|
|
+ allocationWarehouseSn: this.$route.params.sn
|
|
|
+ }
|
|
|
+ allocWarehouseDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
|
|
|
+ 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].outQty = data.list[i].allocationQty
|
|
|
+ data.list[i].outQtyBackups = data.list[i].allocationQty
|
|
|
+ }
|
|
|
+ this.chooseLoadData = data.list
|
|
|
+ this.chooseDisabled = false
|
|
|
+ } else {
|
|
|
+ this.choosePaginationProps.total = 0
|
|
|
+ this.choosePaginationProps.current = 1
|
|
|
+ this.chooseLoadData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 已选产品 调出数量 blur
|
|
|
+ outQtyBlur (val, record) {
|
|
|
+ // 光标移出,值发生改变再调用编辑接口
|
|
|
+ if (val != record.outQtyBackups) {
|
|
|
+ this.handleAdd(record, 'edit')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 已选产品 仓位 change
|
|
|
+ chooseWarehouseLocChange (record) {
|
|
|
+ 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不传,此处应查询所有产品
|
|
|
+ dealerProductBrandQuery({}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.productBrandList = res.data
|
|
|
+ } else {
|
|
|
+ this.productBrandList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 产品分类 列表
|
|
|
+ getProductType () {
|
|
|
+ dealerProductTypeList({}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.productTypeList = res.data
|
|
|
+ } else {
|
|
|
+ this.productTypeList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取仓库仓位
|
|
|
+ getWarehouseLoc (sn, type) {
|
|
|
+ warehouseLocAllList({ warehouseSn: sn }).then(res => {
|
|
|
+ if (type == 'put') {
|
|
|
+ this.warehousePutLocData = res.data || []
|
|
|
+ } else if (type == 'out') {
|
|
|
+ this.warehouseOutLocData = res.data || []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
+ return (
|
|
|
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
- vm.openModal = false
|
|
|
+ vm.getDetail()
|
|
|
+ vm.getProductList(1)
|
|
|
+ vm.getChooseProductList(1)
|
|
|
+ vm.getProductBrand()
|
|
|
+ vm.getProductType()
|
|
|
})
|
|
|
}
|
|
|
}
|