|
@@ -16,52 +16,6 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
- <!--<el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['ams:flowConfig:add']"
|
|
|
- >新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- icon="el-icon-edit"
|
|
|
- size="mini"
|
|
|
- :disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- v-hasPermi="['ams:flowConfig:edit']"
|
|
|
- >修改</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['ams:flowConfig:remove']"
|
|
|
- >删除</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- plain
|
|
|
- icon="el-icon-download"
|
|
|
- size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['ams:flowConfig:export']"
|
|
|
- >导出</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>-->
|
|
|
-
|
|
|
<el-table v-loading="loading" :data="flowConfigList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column label="编号" align="center" prop="id"/>
|
|
@@ -117,7 +71,7 @@
|
|
|
<el-option
|
|
|
v-for="dict in skuTypeCombo"
|
|
|
:key="dict.sku"
|
|
|
- :label="dict.desc1"
|
|
|
+ :label="dict.sku + '-' + dict.desc1"
|
|
|
:value="dict.sku"
|
|
|
/>
|
|
|
</el-select>
|
|
@@ -128,7 +82,7 @@
|
|
|
<el-form-item label="重量" prop="weight" v-if="form.weightFlag !== 'Hidden'">
|
|
|
<el-input v-model="form.weight" :placeholder="`输入范围${form.weightMin}-${form.weightMax}`" type="number"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="供应商" prop="supplier" v-if="form.supplierFlag !== 'Hidden'">
|
|
|
+ <!--<el-form-item label="供应商" prop="supplier" v-if="form.supplierFlag !== 'Hidden'">
|
|
|
<el-select style="width: 100%" v-model="form.supplier" placeholder="请选择供应商" clearable size="small">
|
|
|
<el-option
|
|
|
v-for="dict in supplierCombo"
|
|
@@ -137,7 +91,7 @@
|
|
|
:value="dict.supplierId"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item>-->
|
|
|
<div style="cursor: pointer;" @click="showHidden">
|
|
|
<el-divider content-position="center">批次属性信息</el-divider>
|
|
|
</div>
|
|
@@ -146,37 +100,31 @@
|
|
|
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
|
|
<el-table-column label="批次属性" prop="lotattId">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.lotattName}}
|
|
|
+ <div style="display: inline-block;width: 10px;color:red;">
|
|
|
+ <div v-show="scope.row.lotattFlag === 'Required'">*</div>
|
|
|
+ </div>
|
|
|
+ <div style="display: inline-block;width: 185px;">
|
|
|
+ {{scope.row.lotattName}}
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="属性值" prop="lotattValue">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.row.inputType === 'Text'">
|
|
|
- <div style="display: inline-block;width: 25px;color:red;">
|
|
|
- <div v-show="scope.row.lotattFlag === 'Required'">*</div>
|
|
|
- </div>
|
|
|
- <div style="display: inline-block;width: 185px;"><el-input v-model="scope.row.lotattValue" placeholder=""/></div>
|
|
|
+ <el-input v-model="scope.row.lotattValue" placeholder=""/>
|
|
|
</div>
|
|
|
<div v-if="scope.row.inputType === 'DateBox'">
|
|
|
- <div style="display: inline-block;width: 25px;color:red;">
|
|
|
- <div v-show="scope.row.lotattFlag === 'Required'">*</div>
|
|
|
- </div>
|
|
|
- <div style="display: inline-block;width: 185px;"><el-date-picker v-model="scope.row.lotattValue" type="date" placeholder="" style="width: 100%" value-format="yyyy-MM-dd"/></div>
|
|
|
+ <el-date-picker v-model="scope.row.lotattValue" type="date" placeholder="" style="width: 100%" value-format="yyyy-MM-dd"/>
|
|
|
</div>
|
|
|
<div v-if="scope.row.inputType === 'ComboBox'">
|
|
|
- <div style="display: inline-block;width: 25px;color:red;">
|
|
|
- <div v-show="scope.row.lotattFlag === 'Required'">*</div>
|
|
|
- </div>
|
|
|
- <div style="display: inline-block;width: 185px;">
|
|
|
- <el-select v-model="scope.row.lotattValue" placeholder="请选择" clearable size="small" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type[scope.row.inputScope]"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
+ <el-select v-model="scope.row.lotattValue" placeholder="请选择" clearable size="small" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type[scope.row.inputScope]"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -191,10 +139,37 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <div style="cursor: pointer;">
|
|
|
+ <el-divider content-position="center">呼叫明细</el-divider>
|
|
|
+ </div>
|
|
|
+ <el-table :data="subData" :row-class-name="rowFlowConfigDetailsIndex"
|
|
|
+ @selection-change="handleFlowConfigDetailsSelectionChange" ref="flowConfigDetails">
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="delDetail(scope.$index)"
|
|
|
+ v-hasPermi="['ams:flowConfig:edit']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物料" prop="sku" width="200"/>
|
|
|
+ <el-table-column label="数量" prop="qty"/>
|
|
|
+ <el-table-column label="重量" prop="weight"/>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in tableOption"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ align="center" :prop="item.prop" width="200">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="addDetail">添 加</el-button>
|
|
|
<el-button type="primary" @click="submitForm">执 行</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -219,6 +194,7 @@
|
|
|
import {querySupplierDict} from "@/api/base/supplier";
|
|
|
import {treeselect} from "@/api/base/locationInfo";
|
|
|
import {inputTag} from "@/utils/combo/dict";
|
|
|
+ import { lotattConfigList } from "@/api/ams/config";
|
|
|
|
|
|
export default {
|
|
|
name: "FlowConfig",
|
|
@@ -268,14 +244,28 @@
|
|
|
locationToOptions: undefined,
|
|
|
locationFromCombo: undefined,
|
|
|
locationToCombo: undefined,
|
|
|
- attShowFlag: false
|
|
|
+ attShowFlag: false,
|
|
|
+ tableOption: [],
|
|
|
+ subData: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.initLotatt();
|
|
|
this.init();
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ initLotatt() {
|
|
|
+ lotattConfigList().then(response => {
|
|
|
+ let data = response.data
|
|
|
+ for(let i=0;i<data.length;i++) {
|
|
|
+ let obj = new Object();
|
|
|
+ obj.label = data[i].lotattName
|
|
|
+ obj.prop = data[i].lotattId
|
|
|
+ this.tableOption.push(obj)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 查询流程配置头列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -371,37 +361,37 @@
|
|
|
|
|
|
if (this.form.locationFromFlag === 'Required') {
|
|
|
this.rules.locationFrom = [
|
|
|
- {required: true, message: "起始库位不能为空", trigger: "blur"}
|
|
|
+ {required: true, message: "*", trigger: "blur"}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
if (this.form.skuTypeFlag === 'Required') {
|
|
|
this.rules.sku = [
|
|
|
- {required: true, message: "物料不能为空", trigger: "blur"}
|
|
|
+ {required: true, message: "*", trigger: "blur"}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
if (this.form.qtyFlag === 'Required') {
|
|
|
this.rules.qty = [
|
|
|
- {required: true, message: "数量不能为空", trigger: "blur"}
|
|
|
+ {required: true, message: "*", trigger: "blur"}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
if (this.form.weightFlag === 'Required') {
|
|
|
this.rules.weight = [
|
|
|
- {required: true, message: "重量不能为空", trigger: "blur"}
|
|
|
+ {required: true, message: "*", trigger: "blur"}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
if (this.form.supplierFlag === 'Required') {
|
|
|
this.rules.supplier = [
|
|
|
- {required: true, message: "供应商不能为空", trigger: "blur"}
|
|
|
+ {required: true, message: "*", trigger: "blur"}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
if (this.form.locationToFlag === 'Required') {
|
|
|
this.rules.locationTo = [
|
|
|
- {required: true, message: "目标库位不能为空", trigger: "blur"}
|
|
|
+ {required: true, message: "*", trigger: "blur"}
|
|
|
]
|
|
|
}
|
|
|
|
|
@@ -474,8 +464,11 @@
|
|
|
obj.lotattValue = this.flowConfigDetailsList[i].lotattValue
|
|
|
lineCallDetailsFormList.push(obj)
|
|
|
}
|
|
|
+ if(this.subData.length == 0) {
|
|
|
+ this.addDetail()
|
|
|
+ }
|
|
|
this.form.lineCallDetailsFormList = lineCallDetailsFormList
|
|
|
- exec(this.form).then(response => {
|
|
|
+ exec(this.subData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.$modal.msgSuccess("执行成功");
|
|
|
this.open = false;
|
|
@@ -535,6 +528,68 @@
|
|
|
},
|
|
|
digClose () {
|
|
|
this.rules = {}
|
|
|
+ },
|
|
|
+ addDetail () {
|
|
|
+ this.$refs["relForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.skuTypeFlag === 'Required' && this.form.skuType === '') {
|
|
|
+ this.$modal.msgError("物料必须选择");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
|
|
|
+ this.$modal.msgError("数量必须输入");
|
|
|
+ return
|
|
|
+ } else if (this.form.qtyFlag === 'Required' && (this.form.qtyMin != null || this.form.qtyMax != null)) {
|
|
|
+ if (this.form.qty < this.form.qtyMin) {
|
|
|
+ this.$modal.msgError("数量小于范围:" + this.form.qtyMin);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.qty > this.form.qtyMax) {
|
|
|
+ this.$modal.msgError("数量大于范围:" + this.form.qtyMax);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.form.weightFlag === 'Required' && this.form.weight === null) {
|
|
|
+ this.$modal.msgError("重量必须输入");
|
|
|
+ return
|
|
|
+ } else if (this.form.weightFlag === 'Required' && (this.form.weightMin != null || this.form.weightMax != null)) {
|
|
|
+ if (this.form.weight < this.form.weightMin) {
|
|
|
+ this.$modal.msgError("重量小于范围:" + this.form.weightMin);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.weight > this.form.weightMax) {
|
|
|
+ this.$modal.msgError("重量大于范围:" + this.form.weightMax);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.form.supplierFlag === 'Required' && this.form.supplier === null) {
|
|
|
+ this.$modal.msgError("供应商必须输入");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.locationFromFlag === 'Required' && this.form.locationFrom === null) {
|
|
|
+ this.$modal.msgError("必须选择起点位置");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.locationToFlag === 'Required' && this.form.locationTo === null) {
|
|
|
+ this.$modal.msgError("必须选择终点位置");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.flowConfigDetailsList.length > 0) {
|
|
|
+ for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
|
|
|
+ if (this.flowConfigDetailsList[i].lotattFlag === 'Required') {
|
|
|
+ if(this.flowConfigDetailsList[i].lotattValue === '' || this.flowConfigDetailsList[i].lotattValue === null) {
|
|
|
+ this.$modal.msgError(this.flowConfigDetailsList[i].lotattName+"必须输入");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.subData.push(this.form)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ delDetail (index) {
|
|
|
+ this.subData.splice(index, 1)
|
|
|
}
|
|
|
}
|
|
|
};
|