|
@ -36,7 +36,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12" key="优先级col"> |
|
|
<el-col :span="12" key="优先级col"> |
|
|
<el-form-item key="优先级formItem" :label="t('ts.优先级').replace('ts.','')" prop="priority"> |
|
|
<el-form-item key="优先级formItem" :label="t('ts.优先级').replace('ts.','')" prop="priority"> |
|
|
<el-input-number key="优先级input" v-model="formData.priority" :min="0" :disabled="formData.name=='默认规则'&&formType=='update'"/> |
|
|
<el-input-number key="优先级input" v-model="formData.priority" :min="1" :disabled="formData.name=='默认规则'&&formType=='update'"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12" key="状态col"> |
|
|
<el-col :span="12" key="状态col"> |
|
@ -51,106 +51,57 @@ |
|
|
<div key="规则条件title" class="title">{{t('ts.规则条件').replace('ts.','')}}</div> |
|
|
<div key="规则条件title" class="title">{{t('ts.规则条件').replace('ts.','')}}</div> |
|
|
<el-row key="规则条件row"> |
|
|
<el-row key="规则条件row"> |
|
|
<el-col :span="24" v-for="(item, index) in formData.condition" :key="'规则条件row'+index"> |
|
|
<el-col :span="24" v-for="(item, index) in formData.condition" :key="'规则条件row'+index"> |
|
|
<!-- 供应商类型 --> |
|
|
<!-- 受入地 --> |
|
|
<el-form-item key="供应商类型formItem" |
|
|
<el-form-item key="受入地formItem" label="受入地" class="err-120" v-if="index==0"> |
|
|
v-if="item.ParamCode == 'SupplierType'" |
|
|
<el-select key="受入地Operator" |
|
|
:label="t('ts.供应商类型').replace('ts.','')" |
|
|
|
|
|
class="flex-top err-120" |
|
|
|
|
|
> |
|
|
|
|
|
<el-select key="供应商类型Operator" |
|
|
|
|
|
v-model="item.Operator" |
|
|
v-model="item.Operator" |
|
|
:placeholder="t('ts.请选择范围').replace('ts.','')" |
|
|
placeholder="请选择范围" |
|
|
style="width: 110px; margin-right: 10px" |
|
|
style="width: 110px; margin-right: 10px" |
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
|
|
|
@change="OperatorChange($event,item)" |
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
:label="t(`ts.${cur.label}`).replace('ts.','')" |
|
|
:label="cur.label" |
|
|
:value="cur.value" |
|
|
:value="cur.value" |
|
|
v-for="cur in options.supplierTypeRangeOptions" |
|
|
v-for="cur in options.WarehouseCodeRangeOptions" |
|
|
:key="'供应商类型Operator'+cur.value" |
|
|
:key="'受入地Operator'+cur.value" |
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-select key="供应商类型Value" |
|
|
|
|
|
v-model="item.Value" |
|
|
|
|
|
:placeholder="t('ts.请选择供应商类型').replace('ts.','')" |
|
|
|
|
|
style="flex: 1" |
|
|
|
|
|
clearable |
|
|
|
|
|
@change="changeSupplierType" |
|
|
|
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" |
|
|
|
|
|
:key="'供应商类型Value'+dict.value" |
|
|
|
|
|
:label="t(`ts.${dict.label}`).replace('ts.','')" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
|
|
|
<el-input key="受入地Value" style="flex:1" placeholder="请选择受入地" v-model="item.Value" @blur="blurWarehouseByCodes"> |
|
|
|
|
|
<template #suffix> |
|
|
|
|
|
<el-button :disabled="formData.name=='默认规则'&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> |
|
|
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 供应商 --> |
|
|
<!-- 供应商代码 --> |
|
|
<el-form-item key="供应商formItem" |
|
|
<el-form-item key="供应商代码formItem" |
|
|
v-else-if="item.ParamCode == 'SupplierCode'" |
|
|
v-else-if="item.ParamCode == 'SupplierCode'" |
|
|
:label="t('ts.供应商').replace('ts.','')" |
|
|
:label="t('ts.供应商代码').replace('ts.','')" |
|
|
class="err-120" |
|
|
class="err-120" |
|
|
> |
|
|
> |
|
|
<el-select key="供应商Operator" |
|
|
<el-select key="供应商代码Operator" |
|
|
v-model="item.Operator" |
|
|
v-model="item.Operator" |
|
|
:placeholder="t('ts.请选择范围').replace('ts.','')" |
|
|
:placeholder="t('ts.请选择范围').replace('ts.','')" |
|
|
style="width: 110px; margin-right: 10px" |
|
|
style="width: 110px; margin-right: 10px" |
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
|
|
|
@change="OperatorChange($event,item)" |
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
:label="t(`ts.${cur.label}`).replace('ts.','')" |
|
|
:label="t(`ts.${cur.label}`).replace('ts.','')" |
|
|
:value="cur.value" |
|
|
:value="cur.value" |
|
|
v-for="cur in options.supplierRangeOptions" |
|
|
v-for="cur in options.supplierRangeOptions" |
|
|
:key="'供应商Operator'+cur.value" |
|
|
:key="'供应商代码Operator'+cur.value" |
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-select key="供应商Value" |
|
|
|
|
|
v-model="item.Value" |
|
|
|
|
|
:placeholder="t('ts.请选择供应商').replace('ts.','')" |
|
|
|
|
|
style="flex: 1" |
|
|
|
|
|
clearable |
|
|
|
|
|
multiple |
|
|
|
|
|
collapse-tags |
|
|
|
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="cur in options.supplierList" |
|
|
|
|
|
:key="'供应商Value'+cur.code" |
|
|
|
|
|
:label="t(`ts.${cur.name}`).replace('ts.','')" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<!-- 星期几 --> |
|
|
|
|
|
<el-form-item key="星期几formItem" |
|
|
|
|
|
v-else-if="item.ParamCode == 'Weekday'" |
|
|
|
|
|
:label="t('ts.星期几').replace('ts.','')" |
|
|
|
|
|
class="flex-top err-120" |
|
|
|
|
|
> |
|
|
|
|
|
<el-select key="星期几Operator" |
|
|
|
|
|
v-model="item.Operator" |
|
|
|
|
|
placeholder="请选择范围" |
|
|
|
|
|
style="width: 110px; margin-right: 10px" |
|
|
|
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
:label="t(`ts.${cur.label}`).replace('ts.','')" |
|
|
|
|
|
:value="cur.value" |
|
|
|
|
|
v-for="cur in options.weekRangeOptions" |
|
|
|
|
|
:key="'星期几Operator'+cur.value" |
|
|
|
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<div class="checkbox"> |
|
|
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurSupplierCode"> |
|
|
<el-checkbox-group v-model="item.Value"> |
|
|
<template #suffix> |
|
|
<el-checkbox |
|
|
<el-button :disabled="formData.name=='默认规则'&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchSupplier"> |
|
|
:label="t(`ts.${cur.label}`).replace('ts.','')" |
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
v-for="cur in options.weekOptions" |
|
|
</el-button> |
|
|
:key="'星期几Value'+cur.value" |
|
|
</template> |
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
</el-input> |
|
|
/> |
|
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
@ -183,71 +134,32 @@ |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 仓库 --> |
|
|
|
|
|
<el-form-item key="仓库formItem" :label="t('ts.仓库').replace('ts.','')" prop="WarehouseCode"> |
|
|
|
|
|
<el-select key="仓库" |
|
|
|
|
|
v-model="formData.configuration.WarehouseCode" |
|
|
|
|
|
:placeholder="`${t('ts.请选择').replace('ts.','')}${ |
|
|
|
|
|
formData.configuration.WarehouseCode == 'WarehouseCode' |
|
|
|
|
|
? '仓库' |
|
|
|
|
|
: formData.configuration.WarehouseCode == 'AreaCode' |
|
|
|
|
|
? '库区' |
|
|
|
|
|
: formData.configuration.WarehouseCode == 'LocationGroupCode' |
|
|
|
|
|
? '库位组' |
|
|
|
|
|
: formData.configuration.WarehouseCode == 'LocationCode' |
|
|
|
|
|
? '库位' |
|
|
|
|
|
: '' |
|
|
|
|
|
}`" |
|
|
|
|
|
clearable |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="cur in options.warehouseList" |
|
|
|
|
|
:key="'仓库'+cur.code" |
|
|
|
|
|
:label="cur.code" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<!-- 月台 --> |
|
|
<!-- 月台 --> |
|
|
<el-form-item key="月台formItem" :label="t('ts.月台').replace('ts.','')" prop="DockCode"> |
|
|
<el-form-item key="月台formItem" :label="t('ts.月台').replace('ts.','')" prop="DockCode"> |
|
|
<el-select key="月台" |
|
|
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode"> |
|
|
v-model="formData.configuration.DockCode" |
|
|
<template #suffix> |
|
|
:placeholder="t('ts.请选择月台').replace('ts.','')" |
|
|
<el-button :disabled="formData.name=='默认规则'&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchDockCode"> |
|
|
clearable |
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
> |
|
|
</el-button> |
|
|
<el-option |
|
|
</template> |
|
|
v-for="cur in options.dockList" |
|
|
</el-input> |
|
|
:key="'月台'+cur.code" |
|
|
|
|
|
:label="cur.code" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<!-- 在途库位 --> |
|
|
|
|
|
<el-form-item key="在途库位formItem" :label="t('ts.在途库位').replace('ts.','')" prop="OnTheWayLocationCode"> |
|
|
|
|
|
<el-select key="在途库位" |
|
|
|
|
|
v-model="formData.configuration.OnTheWayLocationCode" |
|
|
|
|
|
:placeholder="t('ts.请选择在途库位').replace('ts.','')" |
|
|
|
|
|
clearable |
|
|
|
|
|
filterable |
|
|
|
|
|
:filter-method="filterMethodFromLocation" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="cur in options.locationList" |
|
|
|
|
|
:key="'在途库位'+cur.code" |
|
|
|
|
|
:label="cur.code" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 收货人 --> |
|
|
<!-- 收货人 --> |
|
|
<el-form-item key="收货人formItem" :label="t('ts.收货人').replace('ts.','')" prop="Receiver"> |
|
|
<el-form-item key="收货人formItem" :label="t('ts.收货人').replace('ts.','')" prop="Receiver"> |
|
|
<el-input key="收货人" v-model="formData.configuration.Receiver" :placeholder="t('ts.请输入收货人名称').replace('ts.','')" clearable /> |
|
|
<el-input key="收货人" v-model="formData.configuration.Receiver" :placeholder="t('ts.请输入收货人名称').replace('ts.','')" clearable /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 在途库位 --> |
|
|
<!-- 联系电话 --> |
|
|
<el-form-item key="联系电话formItem" :label="t('ts.联系电话').replace('ts.','')" prop="configuration.PhoneNumber"> |
|
|
<el-form-item key="联系电话formItem" :label="t('ts.联系电话').replace('ts.','')" prop="configuration.PhoneNumber"> |
|
|
<el-input key="联系电话" v-model="formData.configuration.PhoneNumber" :placeholder="t('ts.请输入联系电话').replace('ts.','')" clearable /> |
|
|
<el-input key="联系电话" v-model="formData.configuration.PhoneNumber" :placeholder="t('ts.请输入联系电话').replace('ts.','')" clearable /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
<!-- 是否上架 --> |
|
|
|
|
|
<el-form-item key="是否上架formItem" :label="t('ts.是否上架').replace('ts.','')" prop="configuration.PutAway"> |
|
|
|
|
|
<el-switch |
|
|
|
|
|
v-model="formData.configuration.PutAway" |
|
|
|
|
|
active-value="TRUE" |
|
|
|
|
|
inactive-value="FALSE" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</div> |
|
|
</div> |
|
@ -258,18 +170,26 @@ |
|
|
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" /> |
|
|
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" /> |
|
|
</template> |
|
|
</template> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
|
|
|
<SearchTable |
|
|
|
|
|
ref="searchTableRef" |
|
|
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
defineOptions({ name: 'SupplieDeliveryStrategyAddForm' }) |
|
|
defineOptions({ name: 'SupplieDeliveryStrategyAddForm' }) |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { getSupplierList } from '@/api/wms/supplier' |
|
|
|
|
|
import { getWarehouseList } from '@/api/wms/warehouse' |
|
|
|
|
|
import { getDockList } from '@/api/wms/dock' |
|
|
|
|
|
import { getLocationList } from '@/api/wms/location' |
|
|
|
|
|
import * as RuleApi from '@/api/wms/rule' |
|
|
import * as RuleApi from '@/api/wms/rule' |
|
|
import { isString } from '@/utils/is' |
|
|
import { isString } from '@/utils/is' |
|
|
import {validateHanset} from '@/utils/validator' |
|
|
import { validateHanset } from '@/utils/validator' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import * as WarehouseApi from '@/api/wms/warehouse' |
|
|
|
|
|
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' |
|
|
|
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
|
|
|
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' |
|
|
|
|
|
import * as DockApi from '@/api/wms/dock' |
|
|
|
|
|
import { Dock } from '@/views/wms/basicDataManage/factoryModeling/dock/dock.data' |
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
@ -291,28 +211,23 @@ const formData = ref({ |
|
|
status: true, //状态 |
|
|
status: true, //状态 |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: [ |
|
|
condition: [ |
|
|
// 供应商类型 |
|
|
{ ParamCode: 'WarehouseCode', Operator: 'IN', Value: '',ScreenOperator:'in' }, |
|
|
{ ParamCode: 'SupplierType', Operator: '==', Value: '' }, |
|
|
// 供应商代码 |
|
|
// 供应商 |
|
|
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' ,ScreenOperator:'in'}, |
|
|
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }, |
|
|
|
|
|
// 星期几 |
|
|
|
|
|
{ ParamCode: 'Weekday', Operator: 'IN', Value: [] } |
|
|
|
|
|
], |
|
|
], |
|
|
configuration: { |
|
|
configuration: { |
|
|
// 开始时间 |
|
|
// 开始时间 |
|
|
BeginTime: '', |
|
|
BeginTime: '', |
|
|
// 结束时间 |
|
|
// 结束时间 |
|
|
EndTime: '', |
|
|
EndTime: '', |
|
|
// 仓库代码 |
|
|
|
|
|
WarehouseCode: '', |
|
|
|
|
|
// 月台代码 |
|
|
// 月台代码 |
|
|
DockCode: '', |
|
|
DockCode: '', |
|
|
// 在途库位代码 |
|
|
|
|
|
OnTheWayLocationCode: '', |
|
|
|
|
|
// 收货人 |
|
|
// 收货人 |
|
|
Receiver: '', |
|
|
Receiver: '', |
|
|
// 联系电话 |
|
|
// 联系电话 |
|
|
PhoneNumber: '' |
|
|
PhoneNumber: '', |
|
|
|
|
|
// 是否上架 |
|
|
|
|
|
PutAway:'TRUE' |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -328,16 +243,16 @@ const rules = ref({ |
|
|
|
|
|
|
|
|
// 所有的范围类型 |
|
|
// 所有的范围类型 |
|
|
const rangeOptions = [ |
|
|
const rangeOptions = [ |
|
|
{ value: '==', label: '等于' }, |
|
|
{ value: '==', label: t('ts.等于'),screenValue:'=='}, |
|
|
{ value: '!=', label: '不等于' }, |
|
|
{ value: '!=', label: t('ts.不等于'),screenValue:'!='}, |
|
|
{ value: '>', label: '大于' }, |
|
|
{ value: '>', label: t('ts.大于'),screenValue:'>' }, |
|
|
{ value: '<', label: '小于' }, |
|
|
{ value: '<', label: t('ts.小于'),screenValue:'<'}, |
|
|
{ value: '>=', label: '大于等于' }, |
|
|
{ value: '>=', label: t('ts.大于等于'),screenValue:'>='}, |
|
|
{ value: '<=', label: '小于等于' }, |
|
|
{ value: '<=', label: t('ts.小于等于'),screenValue:'<='}, |
|
|
{ value: 'IN', label: '包含' }, |
|
|
{ value: 'IN', label: t('ts.包含'),screenValue:'in' }, |
|
|
{ value: 'NOT IN', label: '不包含' }, |
|
|
{ value: 'NOT IN', label: t('ts.不包含'),screenValue:'notIn'}, |
|
|
{ value: 'NULL', label: '为空' }, |
|
|
{ value: 'NULL', label: t('ts.是空'),screenValue:'isNull'}, |
|
|
{ value: 'NOT NULL', label: '不为空' } |
|
|
{ value: 'NOT NULL', label: t('ts.不是空'),screenValue:'isNotNull'} |
|
|
] |
|
|
] |
|
|
const formatRangeOptions = (...rest) => { |
|
|
const formatRangeOptions = (...rest) => { |
|
|
// 交集 |
|
|
// 交集 |
|
@ -346,32 +261,10 @@ const formatRangeOptions = (...rest) => { |
|
|
} |
|
|
} |
|
|
// 下拉框列表集合 |
|
|
// 下拉框列表集合 |
|
|
const options = reactive({ |
|
|
const options = reactive({ |
|
|
// 供应商类型范围下拉框列表 |
|
|
// 供应商范围下拉框列表 |
|
|
supplierTypeRangeOptions: formatRangeOptions('=='), |
|
|
WarehouseCodeRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
// 供应商列表 |
|
|
|
|
|
supplierTypeOptions: [], |
|
|
|
|
|
// 供应商范围下拉框列表 |
|
|
// 供应商范围下拉框列表 |
|
|
supplierRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
supplierRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
//供应商列表 |
|
|
|
|
|
supplierList: [], |
|
|
|
|
|
// 星期几范围下拉框列表 |
|
|
|
|
|
weekRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
|
|
|
//星期几列表 |
|
|
|
|
|
weekOptions: [ |
|
|
|
|
|
{ value: 1, label: '星期一' }, |
|
|
|
|
|
{ value: 2, label: '星期二' }, |
|
|
|
|
|
{ value: 3, label: '星期三' }, |
|
|
|
|
|
{ value: 4, label: '星期四' }, |
|
|
|
|
|
{ value: 5, label: '星期五' }, |
|
|
|
|
|
{ value: 6, label: '星期六' }, |
|
|
|
|
|
{ value: 7, label: '星期日' } |
|
|
|
|
|
], |
|
|
|
|
|
//仓库列表 |
|
|
|
|
|
warehouseList: [], |
|
|
|
|
|
//月台列表 |
|
|
|
|
|
dockList: [], |
|
|
|
|
|
//在途库位列表 |
|
|
|
|
|
locationList: [], |
|
|
|
|
|
originLocationList: [] |
|
|
originLocationList: [] |
|
|
}) |
|
|
}) |
|
|
// 弹窗按钮 |
|
|
// 弹窗按钮 |
|
@ -396,49 +289,6 @@ const querySupplierParams = ref({ |
|
|
type: '' |
|
|
type: '' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 获取供应商列表 |
|
|
|
|
|
const getFormSupplierList = async () => { |
|
|
|
|
|
options.supplierList = await getSupplierList(querySupplierParams.value) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 选择供应商类型 |
|
|
|
|
|
const changeSupplierType = (e) => { |
|
|
|
|
|
querySupplierParams.value.type = e |
|
|
|
|
|
formData.value.condition[1].Value = [] |
|
|
|
|
|
getFormSupplierList() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取仓库列表 |
|
|
|
|
|
const getFormWarehouseList = async () => { |
|
|
|
|
|
options.warehouseList = await getWarehouseList() |
|
|
|
|
|
} |
|
|
|
|
|
// 获取月台列表 |
|
|
|
|
|
const getFormDockList = async () => { |
|
|
|
|
|
options.dockList = await getDockList() |
|
|
|
|
|
} |
|
|
|
|
|
const filterMethodFromLocation = (query: string) => { |
|
|
|
|
|
if (query) { |
|
|
|
|
|
options.locationList = options.originLocationList.filter((item) => { |
|
|
|
|
|
return item?.code.includes(query) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
options.locationList = [...options.originLocationList] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 获取库位列表 |
|
|
|
|
|
const getFormLocationList = async () => { |
|
|
|
|
|
if(!options.locationList || options.locationList.length==0){ |
|
|
|
|
|
options.originLocationList = await getLocationList({ type: 'TRANSPORT' }) |
|
|
|
|
|
options.locationList = [...options.originLocationList] |
|
|
|
|
|
}else{ |
|
|
|
|
|
options.locationList = [...options.originLocationList] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getFormSupplierList() |
|
|
|
|
|
getFormWarehouseList() |
|
|
|
|
|
getFormDockList() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
/** 打开弹窗 */ |
|
|
const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
const open = async (type: string, strategyCode: string, id?: number) => { |
|
@ -446,6 +296,7 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
dialogVisible.value = true |
|
|
dialogVisible.value = true |
|
|
dialogTitle.value = t('action.' + type) |
|
|
dialogTitle.value = t('action.' + type) |
|
|
formType.value = type |
|
|
formType.value = type |
|
|
|
|
|
warehouseCodeObj.value ="" |
|
|
resetForm() |
|
|
resetForm() |
|
|
// 修改时,设置数据 |
|
|
// 修改时,设置数据 |
|
|
if (id) { |
|
|
if (id) { |
|
@ -472,27 +323,27 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
// } |
|
|
// } |
|
|
if (data.condition) { |
|
|
if (data.condition) { |
|
|
formData.value.condition = JSON.parse(data.condition) |
|
|
formData.value.condition = JSON.parse(data.condition) |
|
|
formData.value.condition.forEach((item, index) => { |
|
|
// formData.value.condition.forEach((item, index) => { |
|
|
if (item.Operator == 'IN' || item.Operator == 'NOT IN') { |
|
|
// if (item.Operator == 'IN' || item.Operator == 'NOT IN') { |
|
|
item.Value = item.Value.split(',') |
|
|
// item.Value = item.Value.split(',') |
|
|
} |
|
|
// } |
|
|
}) |
|
|
// }) |
|
|
|
|
|
warehouseCodeObj.value = formData.value.condition.find(item => item['ParamCode'] == 'WarehouseCode') || '' |
|
|
} |
|
|
} |
|
|
if (data.configuration) { |
|
|
if (data.configuration) { |
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
} |
|
|
} |
|
|
querySupplierParams.value.type = formData.value?.condition[0]?.Value || '' |
|
|
querySupplierParams.value.type = formData.value?.condition[0]?.Value || '' |
|
|
getFormSupplierList() |
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
formLoading.value = false |
|
|
formLoading.value = false |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
Butttondata.value = [ |
|
|
Butttondata.value = [ |
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
getFormLocationList() |
|
|
|
|
|
} |
|
|
} |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
@ -503,7 +354,7 @@ const submitForm = async () => { |
|
|
if (!formRef) return |
|
|
if (!formRef) return |
|
|
const valid = await formRef.value.validate() |
|
|
const valid = await formRef.value.validate() |
|
|
if (!valid) return |
|
|
if (!valid) return |
|
|
|
|
|
console.log(555,formData.value) |
|
|
// if (formData.value.priority == 0) { |
|
|
// if (formData.value.priority == 0) { |
|
|
// message.error('优先级不可以为0') |
|
|
// message.error('优先级不可以为0') |
|
|
// return |
|
|
// return |
|
@ -525,6 +376,7 @@ const submitForm = async () => { |
|
|
return { |
|
|
return { |
|
|
ParamCode:item.ParamCode, |
|
|
ParamCode:item.ParamCode, |
|
|
Operator:item.Operator, |
|
|
Operator:item.Operator, |
|
|
|
|
|
ScreenOperator:item.ScreenOperator, |
|
|
Value:str |
|
|
Value:str |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -565,27 +417,191 @@ const resetForm = () => { |
|
|
status: true, //状态 |
|
|
status: true, //状态 |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: [ |
|
|
condition: [ |
|
|
// 供应商类型 |
|
|
// 受入地 |
|
|
{ ParamCode: 'SupplierType', Operator: '==', Value: '' }, |
|
|
{ ParamCode: 'WarehouseCode', Operator: 'IN', Value: '',ScreenOperator:'in' }, |
|
|
// 供应商 |
|
|
// 供应商 |
|
|
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }, |
|
|
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' ,ScreenOperator:'in'}, |
|
|
// 星期几 |
|
|
|
|
|
{ ParamCode: 'Weekday', Operator: 'IN', Value: [] } |
|
|
|
|
|
], |
|
|
], |
|
|
configuration: { |
|
|
configuration: { |
|
|
// 开始时间 |
|
|
// 开始时间 |
|
|
BeginTime: '', |
|
|
BeginTime: '', |
|
|
// 结束时间 |
|
|
// 结束时间 |
|
|
EndTime: '', |
|
|
EndTime: '', |
|
|
// 仓库代码 |
|
|
|
|
|
WarehouseCode: '', |
|
|
|
|
|
// 月台代码 |
|
|
// 月台代码 |
|
|
DockCode: '', |
|
|
DockCode: '', |
|
|
// 在途库位代码 |
|
|
// 是否上架 |
|
|
OnTheWayLocationCode: '' |
|
|
PutAway:'TRUE' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
|
|
// 仓库 |
|
|
|
|
|
const searchWarehouse = ()=>{ |
|
|
|
|
|
searchTableRef.value.open( |
|
|
|
|
|
'请选择仓库', |
|
|
|
|
|
Warehouse.allSchemas, |
|
|
|
|
|
WarehouseApi.getWarehousePage, |
|
|
|
|
|
'WarehouseCode', |
|
|
|
|
|
'code', |
|
|
|
|
|
true, |
|
|
|
|
|
undefined, |
|
|
|
|
|
undefined, |
|
|
|
|
|
undefined |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
// 选择供应商 |
|
|
|
|
|
const searchSupplier = () => { |
|
|
|
|
|
searchTableRef.value.open( |
|
|
|
|
|
'请选择供应商', |
|
|
|
|
|
Supplier.allSchemas, |
|
|
|
|
|
SupplierApi.getSupplierPage, |
|
|
|
|
|
'SupplierCode', |
|
|
|
|
|
'code', |
|
|
|
|
|
true, |
|
|
|
|
|
undefined, |
|
|
|
|
|
undefined, |
|
|
|
|
|
undefined |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
const searchDockCode = () => { |
|
|
|
|
|
// if (!warehouseCodeStr.value) { |
|
|
|
|
|
// message.warning('请选择受入地') |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
let filters = [] |
|
|
|
|
|
if (warehouseCodeObj.value?.Value) { |
|
|
|
|
|
filters = [{ |
|
|
|
|
|
action: warehouseCodeObj.value.ScreenOperator, |
|
|
|
|
|
column: 'warehouseCode', |
|
|
|
|
|
value: warehouseCodeObj.value.Value |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
searchTableRef.value.open( |
|
|
|
|
|
'请选择月台', |
|
|
|
|
|
Dock.allSchemas, |
|
|
|
|
|
DockApi.getDockPage, |
|
|
|
|
|
'DockCode', |
|
|
|
|
|
'code', |
|
|
|
|
|
false, |
|
|
|
|
|
undefined, |
|
|
|
|
|
undefined, |
|
|
|
|
|
{ |
|
|
|
|
|
isSearch: true, |
|
|
|
|
|
filters: filters |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
const warehouseCodeObj = ref() |
|
|
|
|
|
const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
|
|
|
if(formField=='WarehouseCode'){ |
|
|
|
|
|
warehouseCodeObj.value = formData.value.condition.find(item => item['ParamCode'] == 'WarehouseCode') |
|
|
|
|
|
if(warehouseCodeObj.value){ |
|
|
|
|
|
warehouseCodeObj.value.Value = val.map(item => (item['code'])).join(',') |
|
|
|
|
|
formData.value.configuration['DockCode']='' |
|
|
|
|
|
} |
|
|
|
|
|
} else if (formField=='SupplierCode') { |
|
|
|
|
|
let SupplierCode = formData.value.condition.find(item => item['ParamCode'] == 'SupplierCode') |
|
|
|
|
|
if(SupplierCode){ |
|
|
|
|
|
SupplierCode.Value = val.map(item=>(item['code'])).join(',') |
|
|
} |
|
|
} |
|
|
|
|
|
} else if (formField=='DockCode') { |
|
|
|
|
|
formData.value.configuration[formField] = val[0][searchField] |
|
|
|
|
|
formData.value.configuration.Receiver = val[0].contactPerson |
|
|
|
|
|
formData.value.configuration.PhoneNumber = val[0].contactPhone |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 受入地失去焦点校验 |
|
|
|
|
|
const blurWarehouseByCodes = async ()=>{ |
|
|
|
|
|
let WarehouseCode = formData.value.condition.find(item=>item['ParamCode']=='WarehouseCode') |
|
|
|
|
|
if(WarehouseCode&&WarehouseCode.Value){ |
|
|
|
|
|
let verifyRes = await WarehouseApi.getWarehouseByCodes({ |
|
|
|
|
|
codes:WarehouseCode.Value |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('事务类型verifyRes',verifyRes) |
|
|
|
|
|
if (verifyRes && verifyRes.length > 0) { |
|
|
|
|
|
const arr1 = WarehouseCode.Value.split(',') |
|
|
|
|
|
if (arr1.length != verifyRes.length) { |
|
|
|
|
|
const arr2 = verifyRes.map((item) => item.code) |
|
|
|
|
|
const str = [ |
|
|
|
|
|
...arr1.filter((item) => !arr2.includes(item)), |
|
|
|
|
|
...arr2.filter((item) => !arr1.includes(item)) |
|
|
|
|
|
].join(',') |
|
|
|
|
|
message.alert('代码' + str + '没有找到对应数据') |
|
|
|
|
|
WarehouseCode.Value = '' |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
WarehouseCode.Value = '' |
|
|
|
|
|
message.alert('暂无数据') |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
WarehouseCode.Value = '' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 供应商失去焦点 |
|
|
|
|
|
const blurSupplierCode = async ()=>{ |
|
|
|
|
|
let SupplierCode = formData.value.condition.find(item=>item['ParamCode']=='SupplierCode') |
|
|
|
|
|
if(SupplierCode&&SupplierCode.Value){ |
|
|
|
|
|
let verifyRes = await SupplierApi.getSupplierListByCodes({ |
|
|
|
|
|
codes:SupplierCode.Value |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('事务类型verifyRes',verifyRes) |
|
|
|
|
|
if (verifyRes && verifyRes.length > 0) { |
|
|
|
|
|
const arr1 = SupplierCode.Value.split(',') |
|
|
|
|
|
if (arr1.length != verifyRes.length) { |
|
|
|
|
|
const arr2 = verifyRes.map((item) => item.code) |
|
|
|
|
|
const str = [ |
|
|
|
|
|
...arr1.filter((item) => !arr2.includes(item)), |
|
|
|
|
|
...arr2.filter((item) => !arr1.includes(item)) |
|
|
|
|
|
].join(',') |
|
|
|
|
|
message.alert('代码' + str + '没有找到对应数据') |
|
|
|
|
|
SupplierCode.Value = '' |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
SupplierCode.Value = '' |
|
|
|
|
|
message.alert('暂无数据') |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
SupplierCode.Value = '' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 月台失去焦点 |
|
|
|
|
|
const blurDockCode = async () => { |
|
|
|
|
|
if (formData.value.configuration.DockCode) { |
|
|
|
|
|
let filters = [] |
|
|
|
|
|
if (warehouseCodeObj.value?.Value) { |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
action: warehouseCodeObj.value.ScreenOperator, |
|
|
|
|
|
column: 'warehouseCode', |
|
|
|
|
|
value: warehouseCodeObj.value.Value |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if (formData.value.configuration.DockCode) { |
|
|
|
|
|
filters.push({ |
|
|
|
|
|
action: '==', |
|
|
|
|
|
column: 'code', |
|
|
|
|
|
value: formData.value.configuration.DockCode |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
let verifyRes = await DockApi.getDockPage({ |
|
|
|
|
|
isSearch:true, |
|
|
|
|
|
filters: filters |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('事务类型verifyRes',verifyRes) |
|
|
|
|
|
if (verifyRes.list && verifyRes.list.length > 0) { |
|
|
|
|
|
} else { |
|
|
|
|
|
formData.value.configuration.DockCode = '' |
|
|
|
|
|
message.alert('暂无数据') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
const OperatorChange = (e, item) => { |
|
|
|
|
|
item.ScreenOperator = rangeOptions.find((item) =>item.value === e)?.screenValue |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
.item { |
|
|
.item { |
|
|