Browse Source

检验策略代码优化

hella_online_20240913
yufei_wang 2 months ago
parent
commit
9b469201e2
  1. 100
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue

100
src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue

@ -13,10 +13,10 @@
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-row> <el-row key="规则row">
<el-col :span="24"> <el-col :span="24" key="代码col">
<el-form-item label="代码" prop="strategyCode"> <el-form-item key="代码formItem" label="代码" prop="strategyCode">
<el-input <el-input key="代码input"
v-model="formData.strategyCode" v-model="formData.strategyCode"
placeholder="请输入代码" placeholder="请输入代码"
clearable clearable
@ -24,24 +24,24 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24" key="名称col">
<el-form-item label="名称" prop="name"> <el-form-item key="名称formItem" label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" clearable :disabled="formData.name=='默认规则'&&formType=='update'"/> <el-input key="名称input" v-model="formData.name" placeholder="请输入名称" clearable :disabled="formData.name=='默认规则'&&formType=='update'"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24" key="描述col">
<el-form-item label="描述" prop="description"> <el-form-item key="描述formItem" label="描述" prop="description">
<el-input v-model="formData.description" placeholder="请输入描述" clearable :disabled="formData.name=='默认规则'&&formType=='update'"/> <el-input key="描述input" v-model="formData.description" placeholder="请输入描述" clearable :disabled="formData.name=='默认规则'&&formType=='update'"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" key="优先级col">
<el-form-item label="优先级" prop="priority"> <el-form-item key="优先级formItem" label="优先级" prop="priority">
<el-input-number v-model="formData.priority" :min="0" :disabled="formData.name=='默认规则'&&formType=='update'"/> <el-input-number key="优先级input" v-model="formData.priority" :min="0" :disabled="formData.name=='默认规则'&&formType=='update'"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" key="状态col">
<el-form-item label="状态" prop="status"> <el-form-item key="状态formItem" label="状态" prop="status">
<el-switch v-model="formData.status" :disabled="formData.name=='默认规则'&&formType=='update'"/> <el-switch key="状态switch" v-model="formData.status" :disabled="formData.name=='默认规则'&&formType=='update'"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -49,11 +49,11 @@
<!-- 规则条件 --> <!-- 规则条件 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则条件</div> <div class="title">规则条件</div>
<el-row> <el-row key="规则条件row">
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> <el-col :span="24" v-for="(item, index) in formData.condition" :key="'规则条件col'+index">
<!-- 供应商类型 --> <!-- 供应商类型 -->
<el-form-item v-if="index == 0" label="供应商类型" class="flex-top err-120"> <el-form-item :key="'供应商类型formItem'+index" v-if="index == 0" label="供应商类型" class="flex-top err-120">
<el-select <el-select :key="'供应商类型select'+index"
v-model="item.Operator" v-model="item.Operator"
placeholder="请选择范围" placeholder="请选择范围"
style="width: 110px; margin-right: 10px" style="width: 110px; margin-right: 10px"
@ -63,10 +63,10 @@
:label="cur.label" :label="cur.label"
:value="cur.value" :value="cur.value"
v-for="cur in options.supplierTypeRangeOptions" v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value" :key="'供应商类型option'+cur.value"
/> />
</el-select> </el-select>
<el-select <el-select :key="'供应商类型Value'+index"
v-model="item.Value" v-model="item.Value"
placeholder="请选择供应商类型" placeholder="请选择供应商类型"
style="flex: 1" style="flex: 1"
@ -78,12 +78,12 @@
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="'供应商类型Value'+dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 供应商 --> <!-- 供应商 -->
<el-form-item <el-form-item :key="'供应商formItem'+index"
v-else-if="index == 1" v-else-if="index == 1"
label="供应商" label="供应商"
class="err-120" class="err-120"
@ -94,7 +94,7 @@
trigger: 'change' trigger: 'change'
}" }"
> >
<el-select <el-select :key="'供应商Operator'+index"
v-model="item.Operator" v-model="item.Operator"
placeholder="请选择范围" placeholder="请选择范围"
style="width: 110px; margin-right: 10px" style="width: 110px; margin-right: 10px"
@ -104,10 +104,10 @@
:label="cur.label" :label="cur.label"
:value="cur.value" :value="cur.value"
v-for="cur in options.supplierRangeOptions" v-for="cur in options.supplierRangeOptions"
:key="cur.value" :key="'供应商option'+cur.value"
/> />
</el-select> </el-select>
<el-select <el-select :key="'供应商Value'+index"
v-model="item.Value" v-model="item.Value"
placeholder="请选择供应商" placeholder="请选择供应商"
style="flex: 1" style="flex: 1"
@ -116,15 +116,15 @@
> >
<el-option <el-option
v-for="cur in options.supplierList" v-for="cur in options.supplierList"
:key="cur.code" :key="'供应商Valueoption'+cur.code"
:label="cur.name" :label="cur.name"
:value="cur.code" :value="cur.code"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 物料 --> <!-- 物料 -->
<el-form-item v-else-if="index == 2" label="物料" class="flex-top err-120"> <el-form-item :key="'物料formItem'+index" v-else-if="index == 2" label="物料" class="flex-top err-120">
<el-select <el-select :key="'供应商Operator'+index"
v-model="item.Operator" v-model="item.Operator"
placeholder="请选择范围" placeholder="请选择范围"
style="width: 110px; margin-right: 10px" style="width: 110px; margin-right: 10px"
@ -134,10 +134,10 @@
:label="cur.label" :label="cur.label"
:value="cur.value" :value="cur.value"
v-for="cur in options.ItemCodeRangeOptions" v-for="cur in options.ItemCodeRangeOptions"
:key="cur.value" :key="'供应商OperatorOption'+cur.value"
/> />
</el-select> </el-select>
<el-input <el-input :key="'供应商Value'+index"
v-model="item.Value" v-model="item.Value"
placeholder="请输入物料,多个物料以逗号分隔" placeholder="请输入物料,多个物料以逗号分隔"
clearable clearable
@ -151,20 +151,20 @@
<!-- 规则配置 --> <!-- 规则配置 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则配置</div> <div class="title">规则配置</div>
<el-row> <el-row key="规则配置row">
<!-- 开始时间 --> <!-- 开始时间 -->
<el-col :span="24"> <el-col :span="24" key="开始时间col">
<!-- 检验方式 --> <!-- 检验方式 -->
<el-form-item label="检验方式" class="flex-top"> <el-form-item label="检验方式" class="flex-top" key="检验方式formItem">
<div class="checkbox"> <div class="checkbox">
<el-radio-group <el-radio-group key="检验方式radioGroup"
v-model="formData.configuration.InspectType" v-model="formData.configuration.InspectType"
@change="changeInspectType" @change="changeInspectType"
> >
<el-radio <el-radio
:label="cur.value" :label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)" v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)"
:key="cur.value" :key="'检验方式radio'+cur.value"
>{{ cur.label }}</el-radio >{{ cur.label }}</el-radio
> >
</el-radio-group> </el-radio-group>
@ -172,15 +172,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 抽检方式 --> <!-- 抽检方式 -->
<el-col :span="24" v-if="formData.configuration.InspectType == 'SAMPLING'"> <el-col :span="24" v-if="formData.configuration.InspectType == 'SAMPLING'" key="抽检方式col">
<el-form-item label="抽检方式" class="flex-top"> <el-form-item label="抽检方式" class="flex-top" key="抽检方式formItem">
<div class="checkbox"> <div class="checkbox">
<el-radio-group v-model="formData.configuration.SampleMethod"> <el-radio-group v-model="formData.configuration.SampleMethod" key="抽检方式radioGroup">
<el-radio <el-radio
:label="cur.value" :label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.SAMPLE_METHOD)" v-for="cur in getStrDictOptions(DICT_TYPE.SAMPLE_METHOD)"
@change="changeSampleMethod" @change="changeSampleMethod"
:key="cur.value" :key="'抽检方式radio'+cur.value"
>{{ cur.label }}</el-radio >{{ cur.label }}</el-radio
> >
</el-radio-group> </el-radio-group>
@ -188,15 +188,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 抽检规则 --> <!-- 抽检规则 -->
<el-col :span="24" v-if="formData.configuration.InspectType == 'SAMPLING'"> <el-col :span="24" v-if="formData.configuration.InspectType == 'SAMPLING'" key="抽检规则col">
<el-form-item label="抽检规则" class="flex-top" prop="configurationRules"> <el-form-item label="抽检规则" class="flex-top" prop="configurationRules" key="抽检规则formItem">
<div <div
style="flex: 1; display: flex; align-items: center; margin-bottom: 10px" style="flex: 1; display: flex; align-items: center; margin-bottom: 10px"
v-for="(cur, key) in formData.configuration.AqlList" v-for="(cur, key) in formData.configuration.AqlList"
:key="key" :key="'抽检规则div'+key"
> >
<div style="width: 26px; display: flex"> <div :key="'抽检规则div1'+key" style="width: 26px; display: flex">
<Icon <Icon :key="'抽检规则icon'+key"
icon="ep:remove" icon="ep:remove"
color="#757575" color="#757575"
size="26" size="26"
@ -205,7 +205,7 @@
v-if="formData.configuration.AqlList?.length > 1" v-if="formData.configuration.AqlList?.length > 1"
/> />
</div> </div>
<el-input-number <el-input-number :key="'抽检规则input1'+key"
v-model="cur.FloorQty" v-model="cur.FloorQty"
:min="1" :min="1"
:max="cur.CeilingQty - 1" :max="cur.CeilingQty - 1"
@ -215,7 +215,7 @@
@blur="inputNumberBlur" @blur="inputNumberBlur"
/> />
<div></div> <div></div>
<el-input-number <el-input-number :key="'抽检规则input2'+key"
v-model="cur.CeilingQty" v-model="cur.CeilingQty"
:min="cur.FloorQty + 1" :min="cur.FloorQty + 1"
class="ml-20px mr-20px" class="ml-20px mr-20px"
@ -224,7 +224,7 @@
@blur="inputNumberBlur" @blur="inputNumberBlur"
/> />
<div>抽样数</div> <div>抽样数</div>
<el-input-number <el-input-number :key="'抽检规则input3'+key"
v-model="cur.SampleValue" v-model="cur.SampleValue"
:min="1" :min="1"
:max="formData.configuration.SampleMethod == 'QTY' ? Infinity : 100" :max="formData.configuration.SampleMethod == 'QTY' ? Infinity : 100"
@ -233,7 +233,7 @@
controls-position="right" controls-position="right"
@blur="inputNumberBlur" @blur="inputNumberBlur"
/> />
<div>{{ formData.configuration.SampleMethod == 'QTY' ? 'EA' : '%' }}</div> <div :key="'抽检规则div2'+key">{{ formData.configuration.SampleMethod == 'QTY' ? 'EA' : '%' }}</div>
</div> </div>
<div class="button flex"> <div class="button flex">
<div @click="handleAddTable(formData.configuration.AqlList)"> <div @click="handleAddTable(formData.configuration.AqlList)">

Loading…
Cancel
Save