|
@@ -1,34 +1,25 @@
|
|
<template>
|
|
<template>
|
|
<div class="bulkWarehousingOrderEdit-wrap">
|
|
<div class="bulkWarehousingOrderEdit-wrap">
|
|
<!-- 内容 -->
|
|
<!-- 内容 -->
|
|
- <a-page-header :ghost="false" @back="handleBack" >
|
|
|
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderEdit-cont" >
|
|
<!-- 自定义的二级文字标题 -->
|
|
<!-- 自定义的二级文字标题 -->
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
- <a id="bulkWarehousingOrderDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
|
|
|
|
|
|
+ <a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
|
+ <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseSn) || '' }}</p>
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra">
|
|
<template slot="extra">
|
|
- <a-button key="2" id="bulkWarehousingOrderDetail-preview-btn">打印预览</a-button>
|
|
|
|
- <a-button key="1" type="primary" id="bulkWarehousingOrderDetail-print-btn">快速打印</a-button>
|
|
|
|
|
|
+ <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn">打印预览</a-button>
|
|
|
|
+ <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn">快速打印</a-button>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
- <!-- 内容 -->
|
|
|
|
- <a-page-header title="单号:CG2021010100001" ></a-page-header>
|
|
|
|
-
|
|
|
|
<!-- 基础信息 -->
|
|
<!-- 基础信息 -->
|
|
<a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
|
|
<a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse-panel key="1">
|
|
<a-collapse-panel key="1">
|
|
<template slot="header">
|
|
<template slot="header">
|
|
基础信息
|
|
基础信息
|
|
- <!-- <a-button
|
|
|
|
- type="primary"
|
|
|
|
- shape="circle"
|
|
|
|
- size="small"
|
|
|
|
- icon="edit"
|
|
|
|
- class="edit-circle-btn"
|
|
|
|
- id="bulkWarehousingOrderEdit-edit-circle-btn"
|
|
|
|
- @click.stop="handleEditInfo" /> -->
|
|
|
|
|
|
+ <!-- <a-button type="primary" shape="circle" size="small" icon="edit" class="edit-circle-btn" id="bulkWarehousingOrderEdit-edit-circle-btn" @click.stop="handleEditInfo" /> -->
|
|
</template>
|
|
</template>
|
|
<a-descriptions :column="3">
|
|
<a-descriptions :column="3">
|
|
<a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
|
|
<a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
|
|
@@ -53,51 +44,60 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="关键词">
|
|
<a-form-item label="关键词">
|
|
- <a-input id="bulkWarehousingOrderEdit-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="产品名称/产品编码/原厂编码"/>
|
|
|
|
|
|
+ <a-input id="bulkWarehousingOrderEdit-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="产品品牌">
|
|
<a-form-item label="产品品牌">
|
|
<a-select
|
|
<a-select
|
|
- placeholder="请选择"
|
|
|
|
- id="bulkWarehousingOrderEdit-state"
|
|
|
|
|
|
+ placeholder="请选择产品品牌"
|
|
|
|
+ id="bulkWarehousingOrderEdit-productBrandSn"
|
|
allowClear
|
|
allowClear
|
|
- v-model="queryParam.dataSourceNo"
|
|
|
|
|
|
+ v-model="queryParam.productBrandSn"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
option-filter-prop="children"
|
|
option-filter-prop="children"
|
|
:filter-option="filterOption">
|
|
: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-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="产品类别">
|
|
|
|
- <a-cascader :options="typeData" id="bulkWarehousingOrderEdit-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
|
|
|
|
|
|
+ <a-form-item label="产品分类">
|
|
|
|
+ <a-cascader
|
|
|
|
+ @change="changeProductType"
|
|
|
|
+ change-on-select
|
|
|
|
+ v-model="productType"
|
|
|
|
+ :options="productTypeList"
|
|
|
|
+ :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
|
+ id="productInfoList-productType"
|
|
|
|
+ placeholder="请选择产品分类"
|
|
|
|
+ allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
|
|
|
|
|
|
+ <a-button style="margin-bottom: 18px;" type="primary" @click="getDealerProductList(1)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="bulkWarehousingOrderEdit-reset">重置</a-button>
|
|
<a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="bulkWarehousingOrderEdit-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <s-table
|
|
|
|
|
|
+ <a-table
|
|
class="sTable"
|
|
class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
size="small"
|
|
size="small"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:customRow="handleClickRow"
|
|
:customRow="handleClickRow"
|
|
- :data="loadData"
|
|
|
|
- :scroll="{ x: 1700, y: 300 }"
|
|
|
|
|
|
+ :dataSource="loadData"
|
|
|
|
+ :scroll="{ x: 1780, y: 300 }"
|
|
|
|
+ :pagination="paginationProps"
|
|
bordered>
|
|
bordered>
|
|
<!-- 成本价 -->
|
|
<!-- 成本价 -->
|
|
- <template slot="costPrice" slot-scope="text, record">
|
|
|
|
|
|
+ <template slot="putCost" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="bulkWarehousingOrderEdit-costPrice"
|
|
|
|
- v-model="record.costPrice"
|
|
|
|
|
|
+ id="bulkWarehousingOrderEdit-putCost"
|
|
|
|
+ v-model="record.putCost"
|
|
:precision="2"
|
|
:precision="2"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
@@ -105,10 +105,10 @@
|
|
style="width: 100%;" />
|
|
style="width: 100%;" />
|
|
</template>
|
|
</template>
|
|
<!-- 数量 -->
|
|
<!-- 数量 -->
|
|
- <template slot="quantity" slot-scope="text, record">
|
|
|
|
|
|
+ <template slot="putQty" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="bulkWarehousingOrderEdit-quantity"
|
|
|
|
- v-model="record.quantity"
|
|
|
|
|
|
+ id="bulkWarehousingOrderEdit-putQty"
|
|
|
|
+ v-model="record.putQty"
|
|
:precision="0"
|
|
:precision="0"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
@@ -116,22 +116,27 @@
|
|
style="width: 100%;" />
|
|
style="width: 100%;" />
|
|
</template>
|
|
</template>
|
|
<!-- 仓库 -->
|
|
<!-- 仓库 -->
|
|
- <template slot="warehouse" slot-scope="text, record">
|
|
|
|
- <a-select id="bulkWarehousingOrderEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
|
|
|
|
|
|
+ <template slot="warehouseSn" slot-scope="text, record, index">
|
|
|
|
+ <a-select
|
|
|
|
+ id="bulkWarehousingOrderEdit-warehouseSn"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ @change="warehouseChange(record, index)"
|
|
|
|
+ v-model="record.warehouseSn"
|
|
|
|
+ style="width: 100%;">
|
|
<a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
<a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</template>
|
|
</template>
|
|
<!-- 仓位 -->
|
|
<!-- 仓位 -->
|
|
- <template slot="position" slot-scope="text, record">
|
|
|
|
- <a-select id="bulkWarehousingOrderEdit-position" placeholder="请选择" allowClear v-model="record.position" style="width: 100%;">
|
|
|
|
- <a-select-option v-for="item in warehouseList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.name }}</a-select-option>
|
|
|
|
|
|
+ <template slot="warehouseLocationSn" slot-scope="text, record, index">
|
|
|
|
+ <a-select id="bulkWarehousingOrderEdit-warehouseLocationSn" placeholder="请选择" v-model="record.warehouseLocationSn" style="width: 100%;">
|
|
|
|
+ <a-select-option v-for="item in warehouseLocList[index]" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
|
|
<a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
|
|
</template>
|
|
</template>
|
|
- </s-table>
|
|
|
|
|
|
+ </a-table>
|
|
</div>
|
|
</div>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</a-collapse>
|
|
@@ -151,55 +156,71 @@
|
|
<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.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
|
|
</a-alert>
|
|
</a-alert>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <s-table
|
|
|
|
|
|
+ <a-table
|
|
class="sTable"
|
|
class="sTable"
|
|
- ref="table"
|
|
|
|
|
|
+ ref="chooseTable"
|
|
size="small"
|
|
size="small"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="chooseColumns"
|
|
:columns="chooseColumns"
|
|
- :data="chooseLoadData"
|
|
|
|
|
|
+ :dataSource="chooseLoadData"
|
|
|
|
+ :scroll="{ x: 1880, y: 300 }"
|
|
|
|
+ :pagination="choosePaginationProps"
|
|
bordered>
|
|
bordered>
|
|
<!-- 成本价 -->
|
|
<!-- 成本价 -->
|
|
- <template slot="costPrice" slot-scope="text, record">
|
|
|
|
|
|
+ <template slot="putCost" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="bulkWarehousingOrderEdit-costPrice"
|
|
|
|
- v-model="record.costPrice"
|
|
|
|
|
|
+ id="bulkWarehousingOrderEdit-choose-putCost"
|
|
|
|
+ v-model="record.putCost"
|
|
:precision="2"
|
|
:precision="2"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
- placeholder="请输入" />
|
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ @blur="e => putCostChange(e.target.value, record)"
|
|
|
|
+ style="width: 100%;" />
|
|
</template>
|
|
</template>
|
|
<!-- 数量 -->
|
|
<!-- 数量 -->
|
|
- <template slot="quantity" slot-scope="text, record">
|
|
|
|
|
|
+ <template slot="putQty" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="bulkWarehousingOrderEdit-quantity"
|
|
|
|
- v-model="record.quantity"
|
|
|
|
|
|
+ id="bulkWarehousingOrderEdit-choose-putQty"
|
|
|
|
+ v-model="record.putQty"
|
|
:precision="0"
|
|
:precision="0"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
- placeholder="请输入" />
|
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ @blur="e => putQtyChange(e.target.value, record)"
|
|
|
|
+ style="width: 100%;" />
|
|
</template>
|
|
</template>
|
|
<!-- 仓库 -->
|
|
<!-- 仓库 -->
|
|
- <template slot="warehouse" slot-scope="text, record">
|
|
|
|
- <a-select id="bulkWarehousingOrderEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse">
|
|
|
|
- <a-select-option v-for="item in warehouseList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
|
|
|
|
+ <template slot="warehouseSn" slot-scope="text, record, index">
|
|
|
|
+ <a-select
|
|
|
|
+ id="bulkWarehousingOrderEdit-choose-warehouseSn"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ @change="chooseWarehouseChange(record, index)"
|
|
|
|
+ v-model="record.warehouseSn"
|
|
|
|
+ style="width: 100%;">
|
|
|
|
+ <a-select-option v-for="item in chooseWarehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</template>
|
|
</template>
|
|
<!-- 仓位 -->
|
|
<!-- 仓位 -->
|
|
- <template slot="position" slot-scope="text, record">
|
|
|
|
- <a-select id="bulkWarehousingOrderEdit-position" placeholder="请选择" allowClear v-model="record.position">
|
|
|
|
- <a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
|
|
|
|
+ <template slot="warehouseLocationSn" slot-scope="text, record, index">
|
|
|
|
+ <a-select id="bulkWarehousingOrderEdit-choose-warehouseLocationSn" placeholder="请选择" @change="chooseWarehouseLocChange(record)" v-model="record.warehouseLocationSn" style="width: 100%;">
|
|
|
|
+ <a-select-option v-for="item in chooseWarehouseLocList[index]" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="primary" @click="handleDel(record)" id="bulkWarehousingOrderEdit-del-btn">删除</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkWarehousingOrderEdit-del-btn">删除</a-button>
|
|
</template>
|
|
</template>
|
|
- </s-table>
|
|
|
|
|
|
+ </a-table>
|
|
</div>
|
|
</div>
|
|
</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: 30px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
|
|
+ <a-button type="primary" id="bulkWarehousingOrderEdit-submit" size="large" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </a-affix>
|
|
<!-- 选择基本信息弹框 -->
|
|
<!-- 选择基本信息弹框 -->
|
|
<basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
<basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
</div>
|
|
</div>
|
|
@@ -208,77 +229,81 @@
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
-import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount } from '@/api/sparePartsPur'
|
|
|
|
|
|
+import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
|
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
|
+import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
|
+import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount, sparePartsPurDetailSave, sparePartsPurDetailDel, sparePartsPurSubmit } from '@/api/sparePartsPur'
|
|
import { dealerProductList } from '@/api/dealerProduct'
|
|
import { dealerProductList } from '@/api/dealerProduct'
|
|
-import { warehouseAllList } from '@/api/warehouse'
|
|
|
|
|
|
+import { warehouseAllList, warehouseLocAllList } from '@/api/warehouse'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, basicInfoModal },
|
|
components: { STable, VSelect, basicInfoModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
queryParam: {
|
|
queryParam: {
|
|
- productBrandSn: undefined
|
|
|
|
- // productBrandSn: undefined,
|
|
|
|
|
|
+ queryWord: '',
|
|
|
|
+ productBrandSn: undefined,
|
|
|
|
+ productTypeSn1: undefined,
|
|
|
|
+ productTypeSn2: undefined,
|
|
|
|
+ productTypeSn3: undefined
|
|
},
|
|
},
|
|
- brandData: [], // 产品品牌 下拉数据
|
|
|
|
- typeData: [], // 产品类别 下拉数据
|
|
|
|
|
|
+ productBrandList: [], // 产品品牌 下拉数据
|
|
|
|
+ productTypeList: [], // 产品分类 下拉数据
|
|
|
|
+ productType: [],
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'code', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'code', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '成本价', scopedSlots: { customRender: 'costPrice' }, width: 150, align: 'center' },
|
|
|
|
- { title: '数量', scopedSlots: { customRender: 'quantity' }, width: 150, align: 'center' },
|
|
|
|
- { title: '仓库', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
|
|
|
|
- { title: '仓位', scopedSlots: { customRender: 'position' }, width: 200, align: 'center' },
|
|
|
|
|
|
+ { title: '成本价', scopedSlots: { customRender: 'putCost' }, width: 150, align: 'center' },
|
|
|
|
+ { title: '数量', scopedSlots: { customRender: 'putQty' }, width: 150, align: 'center' },
|
|
|
|
+ { title: '仓库', scopedSlots: { customRender: 'warehouseSn' }, width: 200, align: 'center' },
|
|
|
|
+ { title: '仓位', scopedSlots: { customRender: 'warehouseLocationSn' }, width: 200, align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
|
- loadData: parameter => {
|
|
|
|
- this.disabled = true
|
|
|
|
- return dealerProductList(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
|
|
|
|
- this.getWarehouseList()
|
|
|
|
- console.log('--------数据', data)
|
|
|
|
- return 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: [
|
|
chooseColumns: [
|
|
- { title: '产品编码', dataIndex: 'creatDate', align: 'center', sorter: true },
|
|
|
|
- { title: '产品名称', dataIndex: 'custName', align: 'center' },
|
|
|
|
- { title: '原厂编码', dataIndex: 'totalP', align: 'center' },
|
|
|
|
- { title: '产品品牌', dataIndex: 'custsName', align: 'center', sorter: true },
|
|
|
|
- { title: '单位', dataIndex: 'custsNdame', align: 'center' },
|
|
|
|
- { title: '成本价', scopedSlots: { customRender: 'costPrice' }, align: 'center' },
|
|
|
|
- { title: '数量', scopedSlots: { customRender: 'quantity' }, align: 'center' },
|
|
|
|
- { title: '成本小计', dataIndex: 'custsNdsame', align: 'center' },
|
|
|
|
- { title: '仓库', scopedSlots: { customRender: 'warehouse' }, align: 'center' },
|
|
|
|
- { title: '仓位', scopedSlots: { customRender: 'position' }, align: 'center' },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
|
|
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 200, align: 'center', sorter: true },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品品牌', dataIndex: 'brandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '成本价', scopedSlots: { customRender: 'putCost' }, width: 150, align: 'center' },
|
|
|
|
+ { title: '数量', scopedSlots: { customRender: 'putQty' }, width: 150, align: 'center' },
|
|
|
|
+ { title: '成本小计', dataIndex: 'costSubtotal', width: 100, align: 'center' },
|
|
|
|
+ { title: '仓库', scopedSlots: { customRender: 'warehouseSn' }, width: 200, align: 'center' },
|
|
|
|
+ { title: '仓位', scopedSlots: { customRender: 'warehouseLocationSn' }, width: 200, align: 'center' },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
|
- chooseLoadData: parameter => {
|
|
|
|
- this.disabled = true
|
|
|
|
- return sparePartsPurDetailList(Object.assign(parameter, { sparePartsPurchaseSn: this.$route.params.sn })).then(res => {
|
|
|
|
- const data = res.data
|
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- data.list[i].no = no + i + 1
|
|
|
|
- }
|
|
|
|
- this.disabled = false
|
|
|
|
- return 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, // 选择基本信息弹框是否显示
|
|
openModal: false, // 选择基本信息弹框是否显示
|
|
warehouseList: [], // 仓库 下拉数据
|
|
warehouseList: [], // 仓库 下拉数据
|
|
|
|
+ warehouseLocList: {}, // 仓位 下拉数据
|
|
|
|
+ chooseWarehouseList: [], // 已选产品 仓库 下拉数据
|
|
|
|
+ chooseWarehouseLocList: {}, // 已选产品 仓位 下拉数据
|
|
basicInfoData: null, // 基本信息
|
|
basicInfoData: null, // 基本信息
|
|
productTotal: null // 合计
|
|
productTotal: null // 合计
|
|
}
|
|
}
|
|
@@ -286,25 +311,47 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 重置
|
|
// 重置
|
|
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.queryWord = ''
|
|
|
|
+ this.queryParam.productBrandSn = undefined
|
|
|
|
+ this.queryParam.productTypeSn1 = ''
|
|
|
|
+ this.queryParam.productTypeSn2 = ''
|
|
|
|
+ this.queryParam.productTypeSn3 = ''
|
|
|
|
+ this.productType = []
|
|
|
|
+ this.getDealerProductList(1)
|
|
},
|
|
},
|
|
// 双击快速添加
|
|
// 双击快速添加
|
|
handleClickRow (record) {
|
|
handleClickRow (record) {
|
|
return {
|
|
return {
|
|
on: {
|
|
on: {
|
|
dblclick: (event) => {
|
|
dblclick: (event) => {
|
|
- console.log(record)
|
|
|
|
|
|
+ this.handleAdd(record)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 获取详情
|
|
|
|
|
|
+ // 分页 一页多少条change
|
|
|
|
+ changePageSize (current, pageSize) {
|
|
|
|
+ this.pageNo = current
|
|
|
|
+ this.pageSize = pageSize
|
|
|
|
+ this.getDealerProductList()
|
|
|
|
+ },
|
|
|
|
+ // 分页 页码change
|
|
|
|
+ changePage (current) {
|
|
|
|
+ this.pageNo = current
|
|
|
|
+ this.getDealerProductList()
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 分页 一页多少条change
|
|
|
|
+ changeChoosePageSize (current, pageSize) {
|
|
|
|
+ this.choosePageNo = current
|
|
|
|
+ this.choosePageSize = pageSize
|
|
|
|
+ this.getChooseDealerProductList()
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 分页 页码change
|
|
|
|
+ changeChoosePage (current) {
|
|
|
|
+ this.choosePageNo = current
|
|
|
|
+ this.getChooseDealerProductList()
|
|
|
|
+ },
|
|
|
|
+ // 基本信息
|
|
getDetail () {
|
|
getDetail () {
|
|
sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
|
|
sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -314,18 +361,80 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 添加
|
|
|
|
- handleAdd (row) {},
|
|
|
|
|
|
+ // 添加/编辑
|
|
|
|
+ handleAdd (row, isEdit) {
|
|
|
|
+ if (!row.putCost) {
|
|
|
|
+ this.$message.warning('请输入成本价')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!row.putQty) {
|
|
|
|
+ this.$message.warning('请输入数量')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!row.warehouseSn) {
|
|
|
|
+ this.$message.warning('请选择仓库')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!row.warehouseLocationSn) {
|
|
|
|
+ this.$message.warning('请选择仓位')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const params = {
|
|
|
|
+ id: isEdit ? row.id : undefined,
|
|
|
|
+ sparePartsPurchaseSn: this.$route.params.sn,
|
|
|
|
+ putCost: row.putCost,
|
|
|
|
+ putQty: row.putQty,
|
|
|
|
+ productCode: isEdit ? row.productCode : row.code,
|
|
|
|
+ productOrigCode: (isEdit ? row.productOrigCode : row.origCode) || undefined,
|
|
|
|
+ productSn: row.productSn,
|
|
|
|
+ productTypeSn1: row.productTypeSn1,
|
|
|
|
+ productTypeSn2: row.productTypeSn2,
|
|
|
|
+ productTypeSn3: row.productTypeSn3,
|
|
|
|
+ brandSn: isEdit ? row.brandSn : row.productBrandSn,
|
|
|
|
+ warehouseLocationSn: row.warehouseLocationSn,
|
|
|
|
+ warehouseSn: row.warehouseSn
|
|
|
|
+ }
|
|
|
|
+ sparePartsPurDetailSave(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.getChooseDealerProductList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 提交
|
|
|
|
+ handleSubmit () {
|
|
|
|
+ const _this = this
|
|
|
|
+ sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ _this.handleBack()
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 删除
|
|
// 删除
|
|
- handleDel (row) {},
|
|
|
|
|
|
+ handleDel (row) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '删除后不可恢复,确定要进行删除吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ sparePartsPurDetailDel({ id: row.id }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.getChooseDealerProductList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 编辑基本信息
|
|
// 编辑基本信息
|
|
handleEditInfo () {
|
|
handleEditInfo () {
|
|
this.openModal = true
|
|
this.openModal = true
|
|
},
|
|
},
|
|
// 基本信息 保存
|
|
// 基本信息 保存
|
|
- handleOk () {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
|
|
+ handleOk () {},
|
|
// 导入明细
|
|
// 导入明细
|
|
handleImport () {
|
|
handleImport () {
|
|
console.log(333)
|
|
console.log(333)
|
|
@@ -335,25 +444,201 @@ export default {
|
|
this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
|
|
this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
|
|
},
|
|
},
|
|
// 仓库下拉数据
|
|
// 仓库下拉数据
|
|
- getWarehouseList () {
|
|
|
|
|
|
+ getWarehouseList (type) {
|
|
warehouseAllList({}).then(res => {
|
|
warehouseAllList({}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.warehouseList = res.data
|
|
|
|
- const defaultFlagInd = this.warehouseList.findIndex(item => item.defaultFlag == 1)
|
|
|
|
- console.log(defaultFlagInd, this.loadData)
|
|
|
|
- // this.loadData.map(item => {
|
|
|
|
- // item.warehouse = this.warehouseList[defaultFlagInd].warehouseSn
|
|
|
|
- // })
|
|
|
|
|
|
+ if (type == 'dealerProduct') { // 全部产品
|
|
|
|
+ this.warehouseList = res.data
|
|
|
|
+ const defaultFlagInd = this.warehouseList.findIndex(item => item.defaultFlag == 1)
|
|
|
|
+ this.loadData.map((item, index) => {
|
|
|
|
+ // 全部产品中,仓库默认值为默认仓库,则仓位必然也为默认仓位,因此可批量设置默认仓位的值 all
|
|
|
|
+ // 解决更改后不实时渲染问题
|
|
|
|
+ this.$set(item, 'warehouseSn', this.warehouseList[defaultFlagInd].warehouseSn)
|
|
|
|
+ this.$set(item, 'nowWarehouseSn', this.warehouseList[defaultFlagInd].warehouseSn) // 所选仓库sn(为记录上一所选仓库sn)
|
|
|
|
+ // 每个仓库对应仓位应是独立的
|
|
|
|
+ this.getWarehouseLocList(this.warehouseList[defaultFlagInd].warehouseSn, index, type, 'all')
|
|
|
|
+ })
|
|
|
|
+ } else if (type == 'sparePartsPurDetail') { // 已选产品
|
|
|
|
+ this.chooseWarehouseList = res.data
|
|
|
|
+ this.chooseLoadData.map((item, index) => {
|
|
|
|
+ // 每个仓库对应仓位应是独立的
|
|
|
|
+ this.getWarehouseLocList(item.warehouseSn, index, type)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.warehouseList = []
|
|
this.warehouseList = []
|
|
|
|
+ this.chooseWarehouseList = []
|
|
|
|
+ this.loadData.map(item => {
|
|
|
|
+ this.$set(item, 'warehouseSn', undefined)
|
|
|
|
+ this.$set(item, 'nowWarehouseSn', undefined)
|
|
|
|
+ this.$set(item, 'warehouseLocationSn', undefined)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 仓位下拉数据
|
|
|
|
+ getWarehouseLocList (warehouseSn, ind, type, isAll, isChange) {
|
|
|
|
+ // warehouseSn仓库sn、ind当前数据下标、type为全部产品或已选产品、isAll为是否设置全部产品内全部仓位的值为默认仓位、isChange为仓库是否change
|
|
|
|
+ warehouseLocAllList({ warehouseSn: warehouseSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ // 处理 全部产品和已选产品以及是否有默认仓位下的不同情况
|
|
|
|
+ this.defaultLocationSet(ind, type, res.data, isAll, isChange)
|
|
|
|
+ } else {
|
|
|
|
+ this.$set(this.warehouseLocList, ind, [])
|
|
|
|
+ this.$set(this.chooseWarehouseLocList, ind, [])
|
|
|
|
+ this.loadData.map(item => {
|
|
|
|
+ this.$set(item, 'warehouseLocationSn', undefined)
|
|
|
|
+ })
|
|
|
|
+ this.chooseLoadData.map(item => {
|
|
|
|
+ this.$set(item, 'warehouseLocationSn', undefined)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ defaultLocationSet (ind, type, data, isAll, isChange) {
|
|
|
|
+ let warehouseLocList
|
|
|
|
+ let loadData
|
|
|
|
+ if (type == 'dealerProduct') { // 全部产品
|
|
|
|
+ warehouseLocList = this.warehouseLocList
|
|
|
|
+ loadData = this.loadData
|
|
|
|
+ } else if (type == 'sparePartsPurDetail') { // 已选产品
|
|
|
|
+ warehouseLocList = this.chooseWarehouseLocList
|
|
|
|
+ loadData = this.chooseLoadData
|
|
|
|
+ }
|
|
|
|
+ this.$set(warehouseLocList, ind, data)
|
|
|
|
+ const defaultFlagInd = warehouseLocList[ind].findIndex(item => item.defaultFlag == 1)
|
|
|
|
+ // 有默认仓位则默认选择默认仓位,无默认仓位则默认选择第一个仓位
|
|
|
|
+ if (defaultFlagInd > -1) { // 有默认仓位
|
|
|
|
+ if (isAll == 'all') { // 批量设置默认仓位的值为默认仓位
|
|
|
|
+ loadData.map(item => {
|
|
|
|
+ this.$set(item, 'warehouseLocationSn', warehouseLocList[ind][defaultFlagInd].warehouseLocationSn)
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$set(loadData[ind], 'warehouseLocationSn', warehouseLocList[ind][defaultFlagInd].warehouseLocationSn)
|
|
|
|
+ }
|
|
|
|
+ loadData[ind].nowWarehouseSn = loadData[ind].warehouseSn
|
|
|
|
+ } else { // 无默认仓位
|
|
|
|
+ if (warehouseLocList[ind].length > 0) {
|
|
|
|
+ loadData[ind].warehouseLocationSn = warehouseLocList[ind][0].warehouseLocationSn
|
|
|
|
+ loadData[ind].nowWarehouseSn = loadData[ind].warehouseSn
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning('当前仓库无仓位,请选择其他仓库')
|
|
|
|
+ loadData[ind].warehouseSn = loadData[ind].nowWarehouseSn
|
|
|
|
+ this.getWarehouseLocList(loadData[ind].warehouseSn, ind, type)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 仓库更改时,应与仓位一齐变更
|
|
|
|
+ if (isChange == 'change' && type == 'sparePartsPurDetail' && warehouseLocList[ind].length > 0) { // 设置已选产品仓库变更时更新数据
|
|
|
|
+ this.handleAdd(loadData[ind], 'edit')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 合计
|
|
// 合计
|
|
getDetailCount () {
|
|
getDetailCount () {
|
|
sparePartsPurDetailCount({ sparePartsPurchaseSn: this.$route.params.sn }).then(res => {
|
|
sparePartsPurDetailCount({ sparePartsPurchaseSn: this.$route.params.sn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.productTotal = res.data
|
|
this.productTotal = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.productTotal = null
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 仓库change
|
|
|
|
+ warehouseChange (record, index) {
|
|
|
|
+ this.loadData[index].warehouseLocationSn = undefined
|
|
|
|
+ this.getWarehouseLocList(this.loadData[index].warehouseSn, index, 'dealerProduct')
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 成本价 change
|
|
|
|
+ putCostChange (val, record) {
|
|
|
|
+ this.handleAdd(record, 'edit')
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 数量 change
|
|
|
|
+ putQtyChange (val, record) {
|
|
|
|
+ this.handleAdd(record, 'edit')
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 仓库 change
|
|
|
|
+ chooseWarehouseChange (record, index) {
|
|
|
|
+ this.chooseLoadData[index].warehouseLocationSn = undefined
|
|
|
|
+ // 仓库仓位为联动更改,因此应在设置仓位后再进行更改
|
|
|
|
+ this.getWarehouseLocList(this.chooseLoadData[index].warehouseSn, index, 'sparePartsPurDetail', undefined, 'change')
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 仓位 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] : ''
|
|
|
|
+ },
|
|
|
|
+ // 产品列表数据
|
|
|
|
+ getDealerProductList (pageNo) {
|
|
|
|
+ this.disabled = true
|
|
|
|
+ this.pageNo = pageNo || this.pageNo
|
|
|
|
+ const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
|
|
|
|
+ dealerProductList(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.getWarehouseList('dealerProduct')
|
|
|
|
+ this.disabled = false
|
|
|
|
+ } else {
|
|
|
|
+ this.paginationProps.total = 0
|
|
|
|
+ this.paginationProps.current = 1
|
|
|
|
+ this.loadData = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 已选产品列表数据
|
|
|
|
+ getChooseDealerProductList () {
|
|
|
|
+ const params = {
|
|
|
|
+ pageNo: this.choosePageNo,
|
|
|
|
+ pageSize: this.choosePageSize,
|
|
|
|
+ sparePartsPurchaseSn: this.$route.params.sn
|
|
|
|
+ }
|
|
|
|
+ sparePartsPurDetailList(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ const data = res.data
|
|
|
|
+ this.choosePaginationProps.total = Number(res.data.count) || 0
|
|
|
|
+ this.choosePaginationProps.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
|
|
|
|
+ // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
|
+ data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
|
|
|
|
+ }
|
|
|
|
+ this.chooseLoadData = data.list
|
|
|
|
+ this.getWarehouseList('sparePartsPurDetail')
|
|
|
|
+ } else {
|
|
|
|
+ this.choosePaginationProps.total = 0
|
|
|
|
+ this.choosePaginationProps.current = 1
|
|
|
|
+ this.chooseLoadData = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 产品品牌 列表
|
|
|
|
+ getProductBrand () {
|
|
|
|
+ dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.productBrandList = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.productBrandList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 产品分类 列表
|
|
|
|
+ getProductType () {
|
|
|
|
+ dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.productTypeList = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.productTypeList = []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -367,7 +652,11 @@ export default {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.openModal = false
|
|
vm.openModal = false
|
|
vm.getDetail()
|
|
vm.getDetail()
|
|
|
|
+ vm.getDealerProductList()
|
|
vm.getDetailCount()
|
|
vm.getDetailCount()
|
|
|
|
+ vm.getChooseDealerProductList()
|
|
|
|
+ vm.getProductBrand()
|
|
|
|
+ vm.getProductType()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|