|
@@ -265,94 +265,7 @@
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <!-- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- label="保质期"
|
|
|
|
- data-step="10"
|
|
|
|
- data-title="保质期"
|
|
|
|
- data-intro="保质期指的是商品的保质期(天),主要针对带生产日期的,此类商品一般有批号"
|
|
|
|
- >
|
|
|
|
- <a-input-number style="width: 100%" placeholder="请输入保质期(天)" v-decorator.trim="['expiryNum']" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- label="仓位货架"
|
|
|
|
- data-step="11"
|
|
|
|
- data-title="仓位货架"
|
|
|
|
- data-intro="仓位货架指的是仓库中的仓位和货架号,主要适用于仓库较大的场景,方便查找商品的准确位置"
|
|
|
|
- >
|
|
|
|
- <a-input style="width: 100%" placeholder="请输入仓位货架" v-decorator.trim="['position']" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- label="制造商"
|
|
|
|
- data-step="12"
|
|
|
|
- data-title="制造商"
|
|
|
|
- data-intro="请填写商品的制造商,一般适用于制造行业"
|
|
|
|
- >
|
|
|
|
- <a-input placeholder="请输入制造商" v-decorator.trim="['mfrs']" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col> -->
|
|
|
|
</a-row>
|
|
</a-row>
|
|
- <!-- <a-row class="form-row" :gutter="24">
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- label="批号"
|
|
|
|
- data-step="14"
|
|
|
|
- data-title="批号"
|
|
|
|
- data-intro="此处是商品的批号开关,如果选择了有,则在采购入库单据需要录入该商品的批号和有效期,在销售出库单据需要选择该商品的批号进行出库"
|
|
|
|
- >
|
|
|
|
- <a-tooltip title="如果选择为有,则在采购入库单需要录入该商品的批号和有效期">
|
|
|
|
- <a-select placeholder="有无批号" v-decorator="['enableBatchNumber']">
|
|
|
|
- <a-select-option value="1">有</a-select-option>
|
|
|
|
- <a-select-option value="0">无</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-tooltip>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24" v-if="!model.id">
|
|
|
|
- <a-form-item
|
|
|
|
- :labelCol="labelCol"
|
|
|
|
- :wrapperCol="wrapperCol"
|
|
|
|
- label="多属性"
|
|
|
|
- data-step="13"
|
|
|
|
- data-title="多属性"
|
|
|
|
- data-intro="多属性是针对的sku商品(比如服装、鞋帽行业),此处开关如果启用就可以在下方进行多sku的配置,配置具体的颜色、尺码之类的组合"
|
|
|
|
- >
|
|
|
|
- <a-tooltip title="多属性针对服装、鞋帽等行业,需要先录入单位才能激活此处输入框">
|
|
|
|
- <a-tag class="tag-info" v-if="!manySkuStatus">需要先录入单位才能激活</a-tag>
|
|
|
|
- <a-select
|
|
|
|
- mode="multiple"
|
|
|
|
- v-decorator="['manySku']"
|
|
|
|
- showSearch
|
|
|
|
- optionFilterProp="children"
|
|
|
|
- placeholder="请选择多属性(可多选)"
|
|
|
|
- @change="onManySkuChange"
|
|
|
|
- v-show="manySkuStatus"
|
|
|
|
- >
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(item, index) in materialAttributeList"
|
|
|
|
- :key="index"
|
|
|
|
- :value="item.value"
|
|
|
|
- :disabled="item.disabled"
|
|
|
|
- >
|
|
|
|
- {{ item.name }}
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-tooltip>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row> -->
|
|
|
|
<a-row class="form-row" :gutter="24">
|
|
<a-row class="form-row" :gutter="24">
|
|
<a-col :md="12" :sm="24" v-if="manySkuSelected >= 1">
|
|
<a-col :md="12" :sm="24" v-if="manySkuSelected >= 1">
|
|
<a-form-item
|
|
<a-form-item
|
|
@@ -419,82 +332,18 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<div style="margin-top: 8px" id="materialDetailModal">
|
|
<div style="margin-top: 8px" id="materialDetailModal">
|
|
- <j-editable-table
|
|
|
|
- ref="editableMeTable"
|
|
|
|
|
|
+ <a-table
|
|
|
|
+ size="middle"
|
|
|
|
+ rowKey="id"
|
|
:loading="meTable.loading"
|
|
:loading="meTable.loading"
|
|
:columns="meTable.columns"
|
|
:columns="meTable.columns"
|
|
:dataSource="meTable.dataSource"
|
|
:dataSource="meTable.dataSource"
|
|
- :height="300"
|
|
|
|
- :minWidth="1000"
|
|
|
|
- :maxHeight="300"
|
|
|
|
- :rowNumber="false"
|
|
|
|
- :rowSelection="true"
|
|
|
|
- :actionButton="true"
|
|
|
|
- @valueChange="onValueChange"
|
|
|
|
- @added="onAdded"
|
|
|
|
- @deleted="onDeleted"
|
|
|
|
|
|
+ :pagination="meTable.pagination"
|
|
|
|
+ :scroll="meTable.scroll"
|
|
|
|
+ bordered
|
|
|
|
+ @change="handleMeTableChange"
|
|
>
|
|
>
|
|
- <template #supplierId="{ handleChange, value }">
|
|
|
|
- <a-select
|
|
|
|
- placeholder="请选择供应商"
|
|
|
|
- v-decorator="['supplierId']"
|
|
|
|
- :dropdownMatchSelectWidth="false"
|
|
|
|
- showSearch
|
|
|
|
- optionFilterProp="children"
|
|
|
|
- :value="value"
|
|
|
|
- @change="($event) => handleChange($event)"
|
|
|
|
- >
|
|
|
|
- <div slot="dropdownRender" slot-scope="menu">
|
|
|
|
- <v-nodes :vnodes="menu" />
|
|
|
|
- <a-divider style="margin: 4px 0" />
|
|
|
|
- <div
|
|
|
|
- style="padding: 4px 8px; cursor: pointer"
|
|
|
|
- @mousedown="(e) => e.preventDefault()"
|
|
|
|
- @click="addVendor"
|
|
|
|
- >
|
|
|
|
- <a-icon type="plus" /> 新增供应商
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <a-select-option v-for="(item, index) in supList" :key="index" :value="item.id">
|
|
|
|
- {{ item.supplier }}
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </template>
|
|
|
|
- <template #depotId="{ handleChange, value }">
|
|
|
|
- <a-select
|
|
|
|
- placeholder="请选择仓库名称"
|
|
|
|
- v-decorator="['depotId']"
|
|
|
|
- :dropdownMatchSelectWidth="false"
|
|
|
|
- showSearch
|
|
|
|
- optionFilterProp="children"
|
|
|
|
- :value="value"
|
|
|
|
- @change="($event) => handleChange($event)"
|
|
|
|
- >
|
|
|
|
- <div slot="dropdownRender" slot-scope="menu">
|
|
|
|
- <v-nodes :vnodes="menu" />
|
|
|
|
- <a-divider style="margin: 4px 0" />
|
|
|
|
- <div
|
|
|
|
- style="padding: 4px 8px; cursor: pointer"
|
|
|
|
- @mousedown="(e) => e.preventDefault()"
|
|
|
|
- @click="addDepot"
|
|
|
|
- >
|
|
|
|
- <a-icon type="plus" /> 新增仓库
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.value">
|
|
|
|
- {{ item.text }}
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </template>
|
|
|
|
- <template #buttonAfter>
|
|
|
|
- <a-button @click="batchSetPrice('purchase')">采购价-批量</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" @click="batchSetPrice('commodity')">零售价-批量</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" @click="batchSetPrice('wholesale')">销售价-批量</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" @click="batchSetPrice('low')">最低售价-批量</a-button>
|
|
|
|
- </template>
|
|
|
|
- </j-editable-table>
|
|
|
|
- <!-- 表单区域 -->
|
|
|
|
- <batch-set-price-modal ref="priceModalForm" @ok="batchSetPriceModalFormOk"></batch-set-price-modal>
|
|
|
|
|
|
+ </a-table>
|
|
</div>
|
|
</div>
|
|
<a-row class="form-row" :gutter="24">
|
|
<a-row class="form-row" :gutter="24">
|
|
<a-col :lg="24" :md="24" :sm="24">
|
|
<a-col :lg="24" :md="24" :sm="24">
|
|
@@ -504,7 +353,39 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
- <a-tab-pane key="2" tab="扩展信息" forceRender>
|
|
|
|
|
|
+ <a-tab-pane key="2" tab="商品条码" forceRender>
|
|
|
|
+ <j-editable-table
|
|
|
|
+ ref="editableProBarCodeTable"
|
|
|
|
+ :loading="mbTable.loading"
|
|
|
|
+ :columns="mbTable.columns"
|
|
|
|
+ :dataSource="mbTable.dataSource"
|
|
|
|
+ :height="300"
|
|
|
|
+ :minWidth="1000"
|
|
|
|
+ :maxHeight="300"
|
|
|
|
+ :rowNumber="false"
|
|
|
|
+ :rowSelection="true"
|
|
|
|
+ :actionButton="true"
|
|
|
|
+ @added="onAdded"
|
|
|
|
+ @deleted="onDeleted"
|
|
|
|
+ >
|
|
|
|
+ <template #ratio="{ handleChange, value }">
|
|
|
|
+ <a-select
|
|
|
|
+ v-if="unitChecked"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :dropdownMatchSelectWidth="false"
|
|
|
|
+ showSearch
|
|
|
|
+ :value="value"
|
|
|
|
+ @change="($event) => handleChange($event)"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option v-for="(item, index) in barCodeUnitList" :key="index" :value="item.ratio">
|
|
|
|
+ {{ item.name }}
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ <a-input v-else :value="value" disabled @change="($event) => handleChange($event)"></a-input>
|
|
|
|
+ </template>
|
|
|
|
+ </j-editable-table>
|
|
|
|
+ </a-tab-pane>
|
|
|
|
+ <a-tab-pane key="3" tab="扩展信息" forceRender>
|
|
<a-row v-if="mpShort.otherField1.enabled" class="form-row" :gutter="24">
|
|
<a-row v-if="mpShort.otherField1.enabled" class="form-row" :gutter="24">
|
|
<a-col :lg="6" :md="6" :sm="6">
|
|
<a-col :lg="6" :md="6" :sm="6">
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="mpShort.otherField1.name">
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="mpShort.otherField1.name">
|
|
@@ -527,7 +408,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
- <a-tab-pane key="3" tab="库存数量" forceRender>
|
|
|
|
|
|
+ <a-tab-pane key="4" tab="库存数量" forceRender>
|
|
<j-editable-table
|
|
<j-editable-table
|
|
ref="editableDepotTable"
|
|
ref="editableDepotTable"
|
|
:loading="depotTable.loading"
|
|
:loading="depotTable.loading"
|
|
@@ -540,7 +421,7 @@
|
|
:actionButton="false"
|
|
:actionButton="false"
|
|
>
|
|
>
|
|
<template #buttonAfter>
|
|
<template #buttonAfter>
|
|
- <!-- <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('initStock')">期初库存-批量</a-button> -->
|
|
|
|
|
|
+ <!-- <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('currentStock')">期初库存-批量</a-button> -->
|
|
<a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('lowSafeStock')">最低安全库存-批量</a-button>
|
|
<a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('lowSafeStock')">最低安全库存-批量</a-button>
|
|
<a-button style="margin-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
|
|
<a-button style="margin-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
|
|
</template>
|
|
</template>
|
|
@@ -548,7 +429,7 @@
|
|
<!-- 表单区域 -->
|
|
<!-- 表单区域 -->
|
|
<batch-set-stock-modal ref="stockModalForm" @ok="batchSetStockModalFormOk"></batch-set-stock-modal>
|
|
<batch-set-stock-modal ref="stockModalForm" @ok="batchSetStockModalFormOk"></batch-set-stock-modal>
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
- <a-tab-pane key="4" tab="图片信息" forceRender>
|
|
|
|
|
|
+ <a-tab-pane key="5" tab="图片信息" forceRender>
|
|
<a-row class="form-row" :gutter="24" style="padding-top: 20px">
|
|
<a-row class="form-row" :gutter="24" style="padding-top: 20px">
|
|
<a-col :lg="18" :md="18" :sm="24">
|
|
<a-col :lg="18" :md="18" :sm="24">
|
|
<a-form-item
|
|
<a-form-item
|
|
@@ -608,10 +489,11 @@ import JImageUpload from '@/components/jeecg/JImageUpload'
|
|
import JDate from '@/components/jeecg/JDate'
|
|
import JDate from '@/components/jeecg/JDate'
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
import { MaterialModalMixins } from '../mixins/MaterialModalMixins'
|
|
import { MaterialModalMixins } from '../mixins/MaterialModalMixins'
|
|
|
|
+import { mixinDevice } from '@/utils/mixin.js'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'MaterialModal',
|
|
name: 'MaterialModal',
|
|
- mixins: [MaterialModalMixins],
|
|
|
|
|
|
+ mixins: [MaterialModalMixins,mixinDevice],
|
|
components: {
|
|
components: {
|
|
BatchSetPriceModal,
|
|
BatchSetPriceModal,
|
|
BatchSetStockModal,
|
|
BatchSetStockModal,
|
|
@@ -697,16 +579,6 @@ export default {
|
|
disabled: true,
|
|
disabled: true,
|
|
defaultValue: '',
|
|
defaultValue: '',
|
|
placeholder: '请输入${title}',
|
|
placeholder: '请输入${title}',
|
|
- // validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '多属性',
|
|
|
|
- key: 'sku',
|
|
|
|
- width: '25%',
|
|
|
|
- type: FormTypes.input,
|
|
|
|
- defaultValue: '',
|
|
|
|
- readonly: true,
|
|
|
|
- placeholder: '请输入${title}',
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '采购价',
|
|
title: '采购价',
|
|
@@ -766,14 +638,6 @@ export default {
|
|
placeholder: '请选择${title}',
|
|
placeholder: '请选择${title}',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '商品条码',
|
|
|
|
- key: 'barCode',
|
|
|
|
- width: '12%',
|
|
|
|
- type: FormTypes.input,
|
|
|
|
- defaultValue: '',
|
|
|
|
- placeholder: '请输入${title}',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
title: '库存(最小单位)',
|
|
title: '库存(最小单位)',
|
|
key: 'inventory',
|
|
key: 'inventory',
|
|
width: '9%',
|
|
width: '9%',
|
|
@@ -790,15 +654,40 @@ export default {
|
|
defaultValue: '',
|
|
defaultValue: '',
|
|
placeholder: '请选择${title}',
|
|
placeholder: '请选择${title}',
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ ],
|
|
|
|
+ pagination: {
|
|
|
|
+ current: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageSizeOptions: ['10', '20', '30', '50', '100'],
|
|
|
|
+ showTotal: (total, range) => {
|
|
|
|
+ return range[0] + '-' + range[1] + ' 共' + total + '条'
|
|
|
|
+ },
|
|
|
|
+ showQuickJumper: true,
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
+ total: 0,
|
|
|
|
+ },
|
|
|
|
+ scroll: {}
|
|
|
|
+ },
|
|
|
|
+ mbTable:{
|
|
|
|
+ loading: false,
|
|
|
|
+ dataSource: [],
|
|
|
|
+ columns: [
|
|
{
|
|
{
|
|
- title: '仓位货架',
|
|
|
|
- key: 'position',
|
|
|
|
- width: '9%',
|
|
|
|
|
|
+ title: '商品条码',
|
|
|
|
+ key: 'barCode',
|
|
|
|
+ width: '15%',
|
|
type: FormTypes.input,
|
|
type: FormTypes.input,
|
|
- defaultValue: '',
|
|
|
|
placeholder: '请输入${title}',
|
|
placeholder: '请输入${title}',
|
|
},
|
|
},
|
|
- ],
|
|
|
|
|
|
+ {
|
|
|
|
+ title: '单位',
|
|
|
|
+ key: 'ratio',
|
|
|
|
+ width: '15%',
|
|
|
|
+ type: FormTypes.slot,
|
|
|
|
+ placeholder: '请输入${title}',
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
depotTable: {
|
|
depotTable: {
|
|
loading: false,
|
|
loading: false,
|
|
@@ -835,6 +724,14 @@ export default {
|
|
defaultValue: '',
|
|
defaultValue: '',
|
|
placeholder: '请输入${title}',
|
|
placeholder: '请输入${title}',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: '仓位货架',
|
|
|
|
+ key: 'position',
|
|
|
|
+ width: '9%',
|
|
|
|
+ type: FormTypes.input,
|
|
|
|
+ defaultValue: '',
|
|
|
|
+ placeholder: '请输入${title}',
|
|
|
|
+ },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
@@ -867,7 +764,9 @@ export default {
|
|
edit: '/material/update',
|
|
edit: '/material/update',
|
|
materialsExtendList: '/materialsExtend/getDetailList',
|
|
materialsExtendList: '/materialsExtend/getDetailList',
|
|
depotWithStock: '/depot/getAllListWithStock',
|
|
depotWithStock: '/depot/getAllListWithStock',
|
|
|
|
+ batchList: '/materialBatch/getDetailList',
|
|
},
|
|
},
|
|
|
|
+ barCodeUnitList: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -883,6 +782,15 @@ export default {
|
|
document.getElementById(this.prefixNo).removeEventListener('keydown', this.handleOkKey)
|
|
document.getElementById(this.prefixNo).removeEventListener('keydown', this.handleOkKey)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ initScroll() {
|
|
|
|
+ if (this.isMobile()) {
|
|
|
|
+ this.meTable.scroll.y = ''
|
|
|
|
+ } else {
|
|
|
|
+ let basicWidth = 150
|
|
|
|
+ this.meTable.scroll.x = document.documentElement.clientWidth - basicWidth - 64
|
|
|
|
+ this.meTable.scroll.y = '100%'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 快捷键
|
|
// 快捷键
|
|
handleOkKey(e) {
|
|
handleOkKey(e) {
|
|
const key = window.event.keyCode ? window.event.keyCode : window.event.which
|
|
const key = window.event.keyCode ? window.event.keyCode : window.event.which
|
|
@@ -894,11 +802,9 @@ export default {
|
|
},
|
|
},
|
|
// 获取所有的editableTable实例
|
|
// 获取所有的editableTable实例
|
|
getAllTable() {
|
|
getAllTable() {
|
|
- return Promise.all([getRefPromise(this, 'editableMeTable'), getRefPromise(this, 'editableDepotTable')])
|
|
|
|
|
|
+ return Promise.all([getRefPromise(this, 'editableProBarCodeTable'),getRefPromise(this, 'editableDepotTable')])
|
|
},
|
|
},
|
|
add() {
|
|
add() {
|
|
- //隐藏多属性
|
|
|
|
- this.meTable.columns[2].type = FormTypes.hidden
|
|
|
|
// 默认新增一条数据
|
|
// 默认新增一条数据
|
|
this.getAllTable().then((editableTables) => {
|
|
this.getAllTable().then((editableTables) => {
|
|
editableTables[0].add()
|
|
editableTables[0].add()
|
|
@@ -908,7 +814,7 @@ export default {
|
|
handleIntroJs('material', 11)
|
|
handleIntroJs('material', 11)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- edit(record) {
|
|
|
|
|
|
+ async edit(record) {
|
|
this.form.resetFields()
|
|
this.form.resetFields()
|
|
this.model = Object.assign({}, record)
|
|
this.model = Object.assign({}, record)
|
|
this.activeKey = '1'
|
|
this.activeKey = '1'
|
|
@@ -968,31 +874,50 @@ export default {
|
|
this.unitChecked = true
|
|
this.unitChecked = true
|
|
this.unitStatus = true
|
|
this.unitStatus = true
|
|
this.manyUnitStatus = false
|
|
this.manyUnitStatus = false
|
|
|
|
+ console.log('多单位-----', record)
|
|
|
|
+ await this.getUnitListByID(record.unitId)
|
|
}
|
|
}
|
|
let params = { materialId: this.model.id }
|
|
let params = { materialId: this.model.id }
|
|
- //编辑商品的时候多属性字段可以修改
|
|
|
|
- this.meTable.columns[2].readonly = false
|
|
|
|
- this.requestMeTableData(this.url.materialsExtendList, params, this.meTable)
|
|
|
|
|
|
+ this.requestProMbTableData(this.url.materialsExtendList, params, this.mbTable)
|
|
|
|
+ this.requestMeTableData()
|
|
this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
|
|
this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
|
|
} else {
|
|
} else {
|
|
this.switchDisabled = false
|
|
this.switchDisabled = false
|
|
- this.meTable.columns[2].readonly = true
|
|
|
|
this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
|
|
this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
|
|
}
|
|
}
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.initScroll()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ requestMeTableData(){
|
|
|
|
+ const params = {
|
|
|
|
+ materialId: this.model.id,
|
|
|
|
+ currentPage: this.meTable.pagination.current,
|
|
|
|
+ pageSize: this.meTable.pagination.pageSize,
|
|
|
|
+ }
|
|
|
|
+ this.meTable.loading = true
|
|
|
|
+ getAction(this.url.batchList, params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.meTable.dataSource = res.data.rows
|
|
|
|
+ this.meTable.pagination.total = Number(res.data.total)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.meTable.loading = false
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/** 查询条码tab的数据 */
|
|
/** 查询条码tab的数据 */
|
|
- requestMeTableData(url, params, tab) {
|
|
|
|
|
|
+ requestProMbTableData(url, params, tab) {
|
|
tab.loading = true
|
|
tab.loading = true
|
|
getAction(url, params)
|
|
getAction(url, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- for (let i = 0; i < res.data.rows.length; i++) {
|
|
|
|
- if (res.data.rows[i].sku) {
|
|
|
|
- this.meTable.columns[2].type = FormTypes.input
|
|
|
|
- } else {
|
|
|
|
- this.meTable.columns[2].type = FormTypes.hidden
|
|
|
|
|
|
+ const rows = (res.data.rows || []).map(item => {
|
|
|
|
+ if(this.unitChecked&&item.ratio){
|
|
|
|
+ const target = this.barCodeUnitList.find(unit => unit.ratio == item.ratio)
|
|
|
|
+ item.commodityUnit = target?target.name : ''
|
|
}
|
|
}
|
|
- }
|
|
|
|
- tab.dataSource = res.data.rows || []
|
|
|
|
|
|
+ return item
|
|
|
|
+ })
|
|
|
|
+ tab.dataSource = rows
|
|
console.log('tab.dataSource-----', tab.dataSource)
|
|
console.log('tab.dataSource-----', tab.dataSource)
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
@@ -1033,10 +958,12 @@ export default {
|
|
validateFields() {
|
|
validateFields() {
|
|
this.getAllTable()
|
|
this.getAllTable()
|
|
.then((tables) => {
|
|
.then((tables) => {
|
|
|
|
+ console.log('tables========', tables)
|
|
/** 一次性验证主表和所有的次表 */
|
|
/** 一次性验证主表和所有的次表 */
|
|
return validateFormAndTables(this.form, tables)
|
|
return validateFormAndTables(this.form, tables)
|
|
})
|
|
})
|
|
.then((allValues) => {
|
|
.then((allValues) => {
|
|
|
|
+ console.log('allValues========',allValues)
|
|
let formData = this.classifyIntoFormData(allValues)
|
|
let formData = this.classifyIntoFormData(allValues)
|
|
formData.sortList = []
|
|
formData.sortList = []
|
|
if (formData.unit === undefined) {
|
|
if (formData.unit === undefined) {
|
|
@@ -1062,22 +989,56 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ async getUnitListByID(id){
|
|
|
|
+ await getAction('/unit/getUnitListByID', { id}).then(res => {
|
|
|
|
+ this.barCodeUnitList = res.data || []
|
|
|
|
+ })
|
|
|
|
+ },
|
|
/** 整理成formData */
|
|
/** 整理成formData */
|
|
classifyIntoFormData(allValues) {
|
|
classifyIntoFormData(allValues) {
|
|
|
|
+
|
|
|
|
+ const that = this
|
|
let materialMain = Object.assign(this.model, allValues.formValue)
|
|
let materialMain = Object.assign(this.model, allValues.formValue)
|
|
|
|
+ console.log('materialMain------mbList------', allValues.tablesValue[0].values)
|
|
return {
|
|
return {
|
|
...materialMain, // 展开
|
|
...materialMain, // 展开
|
|
- meList: allValues.tablesValue[0].values,
|
|
|
|
|
|
+ meList:[],
|
|
stock: allValues.tablesValue[1].values,
|
|
stock: allValues.tablesValue[1].values,
|
|
|
|
+ mbList: allValues.tablesValue[0].values.map(item => {
|
|
|
|
+ let commodityUnit = ''
|
|
|
|
+ // 多单位
|
|
|
|
+ if(that.unitChecked){
|
|
|
|
+ const target = that.barCodeUnitList.find(unit => unit.ratio == item.ratio)
|
|
|
|
+ commodityUnit = target?target.name : ''
|
|
|
|
+ }else{
|
|
|
|
+ commodityUnit = item.ratio
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ barCode: item.barCode,
|
|
|
|
+ ratio: item.ratio,
|
|
|
|
+ commodityUnit: commodityUnit,
|
|
|
|
+ id: item.id.length > 19 ? null : item.id, // 后端接收不了大于19位id
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/** 发起新增或修改的请求 */
|
|
/** 发起新增或修改的请求 */
|
|
requestAddOrEdit(formData) {
|
|
requestAddOrEdit(formData) {
|
|
console.log('formData------------', formData)
|
|
console.log('formData------------', formData)
|
|
- if (formData.meList.length === 0) {
|
|
|
|
|
|
+ if (formData.mbList.length === 0) {
|
|
this.$message.warning('抱歉,请输入条码信息!')
|
|
this.$message.warning('抱歉,请输入条码信息!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ for (const item of formData.mbList){
|
|
|
|
+ if(item.barCode === ''){
|
|
|
|
+ this.$message.warning('抱歉,请输入条码信息!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(item.ratio === ''){
|
|
|
|
+ this.$message.warning('抱歉,条码信息中列表单位不能为空!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
|
|
if (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
|
|
this.$message.warning('抱歉,序列号和批号只能选择一项!')
|
|
this.$message.warning('抱歉,序列号和批号只能选择一项!')
|
|
return
|
|
return
|
|
@@ -1122,80 +1083,9 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // if (!formData.unit) {
|
|
|
|
- // // 此时为多单位
|
|
|
|
- // if (formData.meList.length < 2) {
|
|
|
|
- // this.$message.warning('多单位的商品条码行数至少要有两行,请再新增一行条码信息!')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // if (formData.meList[0].commodityUnit != basicUnit) {
|
|
|
|
- // this.$message.warning(
|
|
|
|
- // '条码之后的单位填写有误,单位【' +
|
|
|
|
- // formData.meList[0].commodityUnit +
|
|
|
|
- // '】请修改为【' +
|
|
|
|
- // basicUnit +
|
|
|
|
- // '】!'
|
|
|
|
- // )
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // if (formData.meList[1].commodityUnit != otherUnit) {
|
|
|
|
- // this.$message.warning(
|
|
|
|
- // '条码之后的单位填写有误,单位【' +
|
|
|
|
- // formData.meList[1].commodityUnit +
|
|
|
|
- // '】请修改为【' +
|
|
|
|
- // otherUnit +
|
|
|
|
- // '】!'
|
|
|
|
- // )
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- let skuCount = 0
|
|
|
|
- for (let i = 0; i < formData.meList.length; i++) {
|
|
|
|
- // let commodityUnit = formData.meList[i].commodityUnit
|
|
|
|
- // if (formData.unit) {
|
|
|
|
- // if (commodityUnit != formData.unit) {
|
|
|
|
- // this.$message.warning(
|
|
|
|
- // '条码之后的单位填写有误,单位【' + commodityUnit + '】请修改为【' + formData.unit + '】!'
|
|
|
|
- // )
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // } else if (formData.unitId) {
|
|
|
|
- // if (
|
|
|
|
- // commodityUnit != basicUnit &&
|
|
|
|
- // commodityUnit != otherUnit &&
|
|
|
|
- // commodityUnit != otherUnitTwo &&
|
|
|
|
- // commodityUnit != otherUnitThree
|
|
|
|
- // ) {
|
|
|
|
- // let warnInfo =
|
|
|
|
- // '条码之后的单位填写有误,单位【' +
|
|
|
|
- // commodityUnit +
|
|
|
|
- // '】请修改为【' +
|
|
|
|
- // basicUnit +
|
|
|
|
- // '】或【' +
|
|
|
|
- // otherUnit +
|
|
|
|
- // '】'
|
|
|
|
- // if (otherUnitTwo) {
|
|
|
|
- // warnInfo += '或【' + otherUnitTwo + '】'
|
|
|
|
- // }
|
|
|
|
- // if (otherUnitThree) {
|
|
|
|
- // warnInfo += '或【' + otherUnitThree + '】'
|
|
|
|
- // }
|
|
|
|
- // warnInfo += '!'
|
|
|
|
- // this.$message.warning(warnInfo)
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- if (formData.sku) {
|
|
|
|
- skuCount++
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
//对最低和最高安全库存进行校验
|
|
//对最低和最高安全库存进行校验
|
|
for (let i = 0; i < formData.stock.length; i++) {
|
|
for (let i = 0; i < formData.stock.length; i++) {
|
|
let depotStockObj = formData.stock[i]
|
|
let depotStockObj = formData.stock[i]
|
|
- if (skuCount && depotStockObj.initStock && depotStockObj.initStock - 0) {
|
|
|
|
- this.$message.warning('抱歉,多属性商品不能录入期初库存,建议进行盘点录入!')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
if (formData.enableSerialNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
|
|
if (formData.enableSerialNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
|
|
this.$message.warning('抱歉,序列号商品不能录入期初库存,建议进行入库单据录入!')
|
|
this.$message.warning('抱歉,序列号商品不能录入期初库存,建议进行入库单据录入!')
|
|
return
|
|
return
|
|
@@ -1337,12 +1227,6 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //控制条码列表中的多属性列
|
|
|
|
- if (value.length > 0) {
|
|
|
|
- this.meTable.columns[2].type = FormTypes.input
|
|
|
|
- } else {
|
|
|
|
- this.meTable.columns[2].type = FormTypes.hidden
|
|
|
|
- }
|
|
|
|
this.barCodeSwitch = false
|
|
this.barCodeSwitch = false
|
|
this.meTable.dataSource = []
|
|
this.meTable.dataSource = []
|
|
},
|
|
},
|
|
@@ -1446,178 +1330,41 @@ export default {
|
|
},
|
|
},
|
|
onAdded(event) {
|
|
onAdded(event) {
|
|
const { row, target } = event
|
|
const { row, target } = event
|
|
- let formUnit = ''
|
|
|
|
- // 勾选多单位
|
|
|
|
- if(this.unitChecked){
|
|
|
|
- const obj = this.unitList.find(item => item.id === this.form.getFieldValue('unitId'))
|
|
|
|
- if(obj){
|
|
|
|
- formUnit = obj.basicUnit
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- formUnit = this.form.getFieldValue('unit')||''
|
|
|
|
|
|
+ // 不勾选多单位
|
|
|
|
+ if(!this.unitChecked){
|
|
|
|
+ let formUnit = this.form.getFieldValue('unit')||''
|
|
|
|
+ target.setValues([{rowKey:row.id, values:{barCode: '', commodityUnit: formUnit}}])
|
|
}
|
|
}
|
|
- target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit, supplierId: undefined, depotId: undefined } }])
|
|
|
|
|
|
+ console.log('onAdded', event)
|
|
},
|
|
},
|
|
onDeleted(value) {
|
|
onDeleted(value) {
|
|
- this.meDeleteIdList = value
|
|
|
|
- },
|
|
|
|
- //单元值改变一个字符就触发一次
|
|
|
|
- onValueChange(event) {
|
|
|
|
- console.log('onValueChange--------table-change', event)
|
|
|
|
- // const { type, row, column, value, target } = event
|
|
|
|
- // switch (column.key) {
|
|
|
|
- // case 'purchaseDecimal':
|
|
|
|
- // case 'commodityDecimal':
|
|
|
|
- // case 'wholesaleDecimal':
|
|
|
|
- // case 'lowDecimal':
|
|
|
|
- // this.changeDecimalByValue(row)
|
|
|
|
- // break
|
|
|
|
- // }
|
|
|
|
- },
|
|
|
|
- //修改商品明细中的价格触发计算
|
|
|
|
- changeDecimalByValue(row) {
|
|
|
|
- let unitArr = this.unitList
|
|
|
|
- let basicUnit = '',
|
|
|
|
- otherUnit = '',
|
|
|
|
- ratio = 1,
|
|
|
|
- otherUnitTwo = '',
|
|
|
|
- ratioTwo = 1,
|
|
|
|
- otherUnitThree = '',
|
|
|
|
- ratioThree = 1
|
|
|
|
- for (let i = 0; i < unitArr.length; i++) {
|
|
|
|
- if (unitArr[i].id === this.form.getFieldValue('unitId')) {
|
|
|
|
- basicUnit = unitArr[i].basicUnit
|
|
|
|
- otherUnit = unitArr[i].otherUnit
|
|
|
|
- ratio = unitArr[i].ratio
|
|
|
|
- if (unitArr[i].otherUnitTwo) {
|
|
|
|
- otherUnitTwo = unitArr[i].otherUnitTwo
|
|
|
|
- ratioTwo = unitArr[i].ratioTwo
|
|
|
|
- }
|
|
|
|
- if (unitArr[i].otherUnitThree) {
|
|
|
|
- otherUnitThree = unitArr[i].otherUnitThree
|
|
|
|
- ratioThree = unitArr[i].ratioThree
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (row.commodityUnit === basicUnit) {
|
|
|
|
- this.$refs.editableMeTable.getValues((error, values) => {
|
|
|
|
- let mArr = values,
|
|
|
|
- basicPurchaseDecimal = '',
|
|
|
|
- basicCommodityDecimal = '',
|
|
|
|
- basicWholesaleDecimal = '',
|
|
|
|
- basicLowDecimal = ''
|
|
|
|
- for (let i = 0; i < mArr.length; i++) {
|
|
|
|
- let mInfo = mArr[i]
|
|
|
|
- if (i === 0) {
|
|
|
|
- basicPurchaseDecimal = mInfo.purchaseDecimal
|
|
|
|
- basicCommodityDecimal = mInfo.commodityDecimal
|
|
|
|
- basicWholesaleDecimal = mInfo.wholesaleDecimal
|
|
|
|
- basicLowDecimal = mInfo.lowDecimal
|
|
|
|
- } else {
|
|
|
|
- //副单位进行换算
|
|
|
|
- if (basicPurchaseDecimal) {
|
|
|
|
- mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicCommodityDecimal) {
|
|
|
|
- mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicWholesaleDecimal) {
|
|
|
|
- mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicLowDecimal) {
|
|
|
|
- mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (otherUnitTwo && i === 2) {
|
|
|
|
- if (basicPurchaseDecimal) {
|
|
|
|
- mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicCommodityDecimal) {
|
|
|
|
- mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicWholesaleDecimal) {
|
|
|
|
- mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicLowDecimal) {
|
|
|
|
- mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (otherUnitThree && i === 3) {
|
|
|
|
- if (basicPurchaseDecimal) {
|
|
|
|
- mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicCommodityDecimal) {
|
|
|
|
- mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicWholesaleDecimal) {
|
|
|
|
- mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
|
|
|
|
- }
|
|
|
|
- if (basicLowDecimal) {
|
|
|
|
- mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.meTable.dataSource = mArr
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- batchSetPrice(type) {
|
|
|
|
- if (this.manySkuSelected > 0 || this.model.id) {
|
|
|
|
- this.$refs.priceModalForm.add(type)
|
|
|
|
- this.$refs.priceModalForm.disableSubmit = false
|
|
|
|
- } else {
|
|
|
|
- this.$message.warning('抱歉,只有开启多属性才能进行批量操作!')
|
|
|
|
- }
|
|
|
|
|
|
+ // this.meDeleteIdList = value
|
|
|
|
+ console.log('onDeleted', value)
|
|
},
|
|
},
|
|
|
|
+ // batchSetPrice(type) {
|
|
|
|
+ // if (this.manySkuSelected > 0 || this.model.id) {
|
|
|
|
+ // this.$refs.priceModalForm.add(type)
|
|
|
|
+ // this.$refs.priceModalForm.disableSubmit = false
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.warning('抱歉,只有开启多属性才能进行批量操作!')
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
batchSetStock(type) {
|
|
batchSetStock(type) {
|
|
this.$refs.stockModalForm.add(type)
|
|
this.$refs.stockModalForm.add(type)
|
|
this.$refs.stockModalForm.disableSubmit = false
|
|
this.$refs.stockModalForm.disableSubmit = false
|
|
},
|
|
},
|
|
- batchSetPriceModalFormOk(price, batchType) {
|
|
|
|
- let arr = this.meTable.dataSource
|
|
|
|
- if (arr.length === 0) {
|
|
|
|
- this.$message.warning('请先录入条码、单位等信息!')
|
|
|
|
- } else {
|
|
|
|
- let meTableData = []
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- let meInfo = {
|
|
|
|
- barCode: arr[i].barCode,
|
|
|
|
- commodityUnit: arr[i].commodityUnit,
|
|
|
|
- sku: arr[i].sku,
|
|
|
|
- purchaseDecimal: arr[i].purchaseDecimal,
|
|
|
|
- commodityDecimal: arr[i].commodityDecimal,
|
|
|
|
- wholesaleDecimal: arr[i].wholesaleDecimal,
|
|
|
|
- lowDecimal: arr[i].lowDecimal,
|
|
|
|
- }
|
|
|
|
- if (batchType === 'purchase') {
|
|
|
|
- meInfo.purchaseDecimal = price - 0
|
|
|
|
- } else if (batchType === 'commodity') {
|
|
|
|
- meInfo.commodityDecimal = price - 0
|
|
|
|
- } else if (batchType === 'wholesale') {
|
|
|
|
- meInfo.wholesaleDecimal = price - 0
|
|
|
|
- } else if (batchType === 'low') {
|
|
|
|
- meInfo.lowDecimal = price - 0
|
|
|
|
- }
|
|
|
|
- if (arr[i].id) {
|
|
|
|
- meInfo.id = arr[i].id
|
|
|
|
- }
|
|
|
|
- meTableData.push(meInfo)
|
|
|
|
- }
|
|
|
|
- this.meTable.dataSource = meTableData
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
batchSetStockModalFormOk(stock, batchType) {
|
|
batchSetStockModalFormOk(stock, batchType) {
|
|
let arr = this.depotTable.dataSource
|
|
let arr = this.depotTable.dataSource
|
|
let depotTableData = []
|
|
let depotTableData = []
|
|
for (let i = 0; i < arr.length; i++) {
|
|
for (let i = 0; i < arr.length; i++) {
|
|
let depotInfo = {
|
|
let depotInfo = {
|
|
name: arr[i].name,
|
|
name: arr[i].name,
|
|
- initStock: arr[i].initStock,
|
|
|
|
|
|
+ currentStock: arr[i].currentStock,
|
|
lowSafeStock: arr[i].lowSafeStock,
|
|
lowSafeStock: arr[i].lowSafeStock,
|
|
highSafeStock: arr[i].highSafeStock,
|
|
highSafeStock: arr[i].highSafeStock,
|
|
}
|
|
}
|
|
- if (batchType === 'initStock') {
|
|
|
|
- depotInfo.initStock = stock - 0
|
|
|
|
|
|
+ if (batchType === 'currentStock') {
|
|
|
|
+ depotInfo.currentStock = stock - 0
|
|
} else if (batchType === 'lowSafeStock') {
|
|
} else if (batchType === 'lowSafeStock') {
|
|
depotInfo.lowSafeStock = stock - 0
|
|
depotInfo.lowSafeStock = stock - 0
|
|
} else if (batchType === 'highSafeStock') {
|
|
} else if (batchType === 'highSafeStock') {
|
|
@@ -1684,103 +1431,18 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.manySkuStatus = false
|
|
this.manySkuStatus = false
|
|
}
|
|
}
|
|
- this.$refs.editableMeTable.getValues((error, values) => {
|
|
|
|
|
|
+ this.$refs.editableProBarCodeTable.getValues((error, values) => {
|
|
let mArr = values
|
|
let mArr = values
|
|
for (let i = 0; i < mArr.length; i++) {
|
|
for (let i = 0; i < mArr.length; i++) {
|
|
let mInfo = mArr[i]
|
|
let mInfo = mArr[i]
|
|
mInfo.commodityUnit = e.target.value
|
|
mInfo.commodityUnit = e.target.value
|
|
}
|
|
}
|
|
- this.meTable.dataSource = mArr
|
|
|
|
|
|
+ this.mbTable.dataSource = mArr
|
|
})
|
|
})
|
|
},
|
|
},
|
|
manyUnitOnChange(value) {
|
|
manyUnitOnChange(value) {
|
|
- let unitArr = this.unitList
|
|
|
|
- let basicUnit = '',
|
|
|
|
- otherUnit = '',
|
|
|
|
- ratio = 1,
|
|
|
|
- otherUnitTwo = '',
|
|
|
|
- ratioTwo = 1,
|
|
|
|
- otherUnitThree = '',
|
|
|
|
- ratioThree = 1
|
|
|
|
- for (let i = 0; i < unitArr.length; i++) {
|
|
|
|
- if (unitArr[i].id === value) {
|
|
|
|
- basicUnit = unitArr[i].basicUnit
|
|
|
|
- otherUnit = unitArr[i].otherUnit
|
|
|
|
- ratio = unitArr[i].ratio
|
|
|
|
- if (unitArr[i].otherUnitTwo) {
|
|
|
|
- otherUnitTwo = unitArr[i].otherUnitTwo
|
|
|
|
- ratioTwo = unitArr[i].ratioTwo
|
|
|
|
- }
|
|
|
|
- if (unitArr[i].otherUnitThree) {
|
|
|
|
- otherUnitThree = unitArr[i].otherUnitThree
|
|
|
|
- ratioThree = unitArr[i].ratioThree
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$refs.editableMeTable.getValues((error, values) => {
|
|
|
|
- let mArr = values,
|
|
|
|
- basicPurchaseDecimal = '',
|
|
|
|
- basicCommodityDecimal = '',
|
|
|
|
- basicWholesaleDecimal = '',
|
|
|
|
- basicLowDecimal = ''
|
|
|
|
- for (let i = 0; i < mArr.length; i++) {
|
|
|
|
- let mInfo = mArr[i]
|
|
|
|
- mInfo.commodityUnit = basicUnit
|
|
|
|
- // if (i === 0) {
|
|
|
|
- // // mInfo.commodityUnit = basicUnit
|
|
|
|
- // basicPurchaseDecimal = mInfo.purchaseDecimal
|
|
|
|
- // basicCommodityDecimal = mInfo.commodityDecimal
|
|
|
|
- // basicWholesaleDecimal = mInfo.wholesaleDecimal
|
|
|
|
- // basicLowDecimal = mInfo.lowDecimal
|
|
|
|
- // } else {
|
|
|
|
- // //副单位进行换算
|
|
|
|
- // // mInfo.commodityUnit = otherUnit
|
|
|
|
- // if (basicPurchaseDecimal) {
|
|
|
|
- // mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicCommodityDecimal) {
|
|
|
|
- // mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicWholesaleDecimal) {
|
|
|
|
- // mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicLowDecimal) {
|
|
|
|
- // mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (otherUnitTwo && i === 2) {
|
|
|
|
- // // mInfo.commodityUnit = otherUnitTwo
|
|
|
|
- // if (basicPurchaseDecimal) {
|
|
|
|
- // mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicCommodityDecimal) {
|
|
|
|
- // mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicWholesaleDecimal) {
|
|
|
|
- // mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicLowDecimal) {
|
|
|
|
- // mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // if (otherUnitThree && i === 3) {
|
|
|
|
- // // mInfo.commodityUnit = otherUnitThree
|
|
|
|
- // if (basicPurchaseDecimal) {
|
|
|
|
- // mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicCommodityDecimal) {
|
|
|
|
- // mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicWholesaleDecimal) {
|
|
|
|
- // mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // if (basicLowDecimal) {
|
|
|
|
- // mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
- this.meTable.dataSource = mArr
|
|
|
|
- })
|
|
|
|
|
|
+ console.log('manyUnitOnChange', value)
|
|
|
|
+ this.getUnitListByID(value)
|
|
},
|
|
},
|
|
unitOnChange(e) {
|
|
unitOnChange(e) {
|
|
let isChecked = e.target.checked
|
|
let isChecked = e.target.checked
|
|
@@ -1793,6 +1455,16 @@ export default {
|
|
this.manyUnitStatus = true
|
|
this.manyUnitStatus = true
|
|
this.unitChecked = false
|
|
this.unitChecked = false
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this.barCodeUnitList = []
|
|
|
|
+ this.$refs.editableProBarCodeTable.getValues((error, values) => {
|
|
|
|
+ let mArr = values
|
|
|
|
+ for (let i = 0; i < mArr.length; i++) {
|
|
|
|
+ let mInfo = mArr[i]
|
|
|
|
+ mInfo.commodityUnit = undefined
|
|
|
|
+ }
|
|
|
|
+ this.mbTable.dataSource = mArr
|
|
|
|
+ })
|
|
},
|
|
},
|
|
addUnit() {
|
|
addUnit() {
|
|
this.$refs.unitModalForm.add()
|
|
this.$refs.unitModalForm.add()
|
|
@@ -1802,10 +1474,16 @@ export default {
|
|
unitModalFormOk() {
|
|
unitModalFormOk() {
|
|
this.loadUnitListData()
|
|
this.loadUnitListData()
|
|
},
|
|
},
|
|
|
|
+ handleMeTableChange(pagination) {
|
|
|
|
+ if (pagination && pagination.current) {
|
|
|
|
+ this.meTable.pagination = pagination
|
|
|
|
+ }
|
|
|
|
+ this.requestMeTableData()
|
|
|
|
+ },
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
-<style scoped>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
.input-table {
|
|
.input-table {
|
|
max-width: 100%;
|
|
max-width: 100%;
|
|
min-width: 1200px;
|
|
min-width: 1200px;
|
|
@@ -1819,4 +1497,5 @@ export default {
|
|
color: #bbb;
|
|
color: #bbb;
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
}
|
|
}
|
|
|
|
+/deep/ .ant-table td { white-space: nowrap; }
|
|
</style>
|
|
</style>
|