|
@@ -0,0 +1,417 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="流程名称" prop="flowName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.flowName"
|
|
|
+ placeholder="请输入流程名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </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" />
|
|
|
+ <el-table-column label="流程名称" align="center" prop="flowName" />
|
|
|
+ <!--<el-table-column label="物料类型" align="center" prop="skuType" />
|
|
|
+ <el-table-column label="物料类型是否显示" align="center" prop="skuTypeFlag" />
|
|
|
+ <el-table-column label="数量" align="center" prop="qty" />
|
|
|
+ <el-table-column label="数量是否显示" align="center" prop="qtyFlag" />
|
|
|
+ <el-table-column label="重量" align="center" prop="weight" />
|
|
|
+ <el-table-column label="重量是否显示" align="center" prop="weightFlag" />
|
|
|
+ <el-table-column label="供应商" align="center" prop="supplier" />
|
|
|
+ <el-table-column label="供应商是否显示" align="center" prop="supplierFlag" />
|
|
|
+ <el-table-column label="起点范围" align="center" prop="locationFrom" />
|
|
|
+ <el-table-column label="起点是否对接设备" align="center" prop="locationFromDevice" />
|
|
|
+ <el-table-column label="终点范围" align="center" prop="locationTo" />
|
|
|
+ <el-table-column label="终点是否对接设备" align="center" prop="locationToDevice" />-->
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >选择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改流程配置头对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="物料" prop="skuType">
|
|
|
+ <el-select style="width: 100%" v-model="form.skuType" :multiple="true" placeholder="请选择物料种类" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in skuTypeCombo"
|
|
|
+ :key="dict.itemCode"
|
|
|
+ :label="dict.itemName"
|
|
|
+ :value="dict.itemCode"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="数量" prop="qty">
|
|
|
+ <el-input v-model="form.qty" placeholder="请输入数量" type="number"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="重量" prop="weight">
|
|
|
+ <el-input v-model="form.weight" placeholder="请输入重量" type="number"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="供应商" prop="supplier">
|
|
|
+ <el-select style="width: 100%" v-model="form.supplier" placeholder="请选择供应商" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in supplierCombo"
|
|
|
+ :key="dict.supplierId"
|
|
|
+ :label="dict.supplierName"
|
|
|
+ :value="dict.supplierId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="起点范围" prop="locationFrom">
|
|
|
+ <el-select style="width: 100%" v-model="form.locationFrom" placeholder="请选择供应商" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in locationFromCombo"
|
|
|
+ :key="dict.id"
|
|
|
+ :label="dict.locationNo"
|
|
|
+ :value="dict.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="终点范围" prop="locationTo">
|
|
|
+ <treeselect
|
|
|
+ :multiple="true"
|
|
|
+ v-model="form.locationTo"
|
|
|
+ :options="locationToOptions"
|
|
|
+ :value-consists-of="'BRANCH_PRIORITY'"
|
|
|
+ :filter-node-method="filterNode"
|
|
|
+ :show-count="true" placeholder="请选择终点范围" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-divider content-position="center">批次属性信息</el-divider>
|
|
|
+ <el-table :data="flowConfigDetailsList" :row-class-name="rowFlowConfigDetailsIndex" @selection-change="handleFlowConfigDetailsSelectionChange" ref="flowConfigDetails">
|
|
|
+ <el-table-column label="序号" align="center" prop="index" width="50"/>
|
|
|
+ <el-table-column label="批次属性" prop="lotattId">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.lotattName}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="是否显示" prop="lotattFlag">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select style="width: 100%" v-model="scope.row.lotattFlag" placeholder="是否显示" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in inputTagCombo"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" prop="remark">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.remark" placeholder="请输入备注" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, listLotattConfig } from "@/api/ams/flowConfig";
|
|
|
+import { choseFlow } from "@/api/ams/lineCall";
|
|
|
+import { querySkuTypeDict } from "@/api/base/skuType";
|
|
|
+import { querySupplierDict } from "@/api/base/supplier";
|
|
|
+import { treeselect } from "@/api/base/locationInfo";
|
|
|
+import { inputTag } from "@/utils/combo/dict";
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "FlowConfig",
|
|
|
+ components: { Treeselect },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 子表选中数据
|
|
|
+ checkedFlowConfigDetails: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 流程配置头表格数据
|
|
|
+ flowConfigList: [],
|
|
|
+ // 流程配置体表格数据
|
|
|
+ flowConfigDetailsList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ flowName: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ flowName: [
|
|
|
+ { required: true, message: "流程名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ label: "label"
|
|
|
+ },
|
|
|
+ inputTagCombo: inputTag,
|
|
|
+ supplierCombo: [],
|
|
|
+ skuTypeCombo: undefined,
|
|
|
+ locationFromOptions: undefined,
|
|
|
+ locationToOptions: undefined,
|
|
|
+ locationFromCombo: undefined
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init();
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询流程配置头列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listFlowConfig(this.queryParams).then(response => {
|
|
|
+ this.flowConfigList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ flowName: null,
|
|
|
+ skuType: null,
|
|
|
+ skuTypeFlag: 'Choice',
|
|
|
+ qty: null,
|
|
|
+ qtyFlag: 'Choice',
|
|
|
+ weight: null,
|
|
|
+ weightFlag: 'Choice',
|
|
|
+ supplier: null,
|
|
|
+ supplierFlag: 'Choice',
|
|
|
+ locationFrom: null,
|
|
|
+ locationTo: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ remark: null
|
|
|
+ };
|
|
|
+ this.flowConfigDetailsList = [];
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加流程配置";
|
|
|
+ // 加载批次属性明细
|
|
|
+ listLotattConfig(this.queryParams).then(response => {
|
|
|
+ this.flowConfigDetailsList = response.data;
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ choseFlow(id).then(response => {
|
|
|
+ this.locationFromCombo = response.locationFrom
|
|
|
+ // this.flowConfigDetailsList = response.data.flowConfigDetailsList;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "线边呼叫";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.form.flowConfigDetailsList = this.flowConfigDetailsList;
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateFlowConfig(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addFlowConfig(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除流程配置编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delFlowConfig(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 流程配置体序号 */
|
|
|
+ rowFlowConfigDetailsIndex({ row, rowIndex }) {
|
|
|
+ row.index = rowIndex + 1;
|
|
|
+ },
|
|
|
+ /** 流程配置体添加按钮操作 */
|
|
|
+ handleAddFlowConfigDetails() {
|
|
|
+ let obj = {};
|
|
|
+ obj.lotattId = "";
|
|
|
+ obj.lotattFlag = "";
|
|
|
+ obj.remark = "";
|
|
|
+ this.flowConfigDetailsList.push(obj);
|
|
|
+ },
|
|
|
+ /** 流程配置体删除按钮操作 */
|
|
|
+ handleDeleteFlowConfigDetails() {
|
|
|
+ if (this.checkedFlowConfigDetails.length == 0) {
|
|
|
+ this.$modal.msgError("请先选择要删除的流程配置体数据");
|
|
|
+ } else {
|
|
|
+ const flowConfigDetailsList = this.flowConfigDetailsList;
|
|
|
+ const checkedFlowConfigDetails = this.checkedFlowConfigDetails;
|
|
|
+ this.flowConfigDetailsList = flowConfigDetailsList.filter(function(item) {
|
|
|
+ return checkedFlowConfigDetails.indexOf(item.index) == -1
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 复选框选中数据 */
|
|
|
+ handleFlowConfigDetailsSelectionChange(selection) {
|
|
|
+ this.checkedFlowConfigDetails = selection.map(item => item.index)
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('ams/flowConfig/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `flowConfig_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ // 筛选节点
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.label.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ // 初始化物料分类
|
|
|
+ querySkuTypeDict().then(response => {
|
|
|
+ this.skuTypeCombo = response.data;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 初始化供应商
|
|
|
+ querySupplierDict().then(response => {
|
|
|
+ this.supplierCombo = response.data;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 初始化库位
|
|
|
+ treeselect().then(response => {
|
|
|
+ this.locationFromOptions = response.data;
|
|
|
+ this.locationToOptions = response.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|